lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sun, 13 May 2012 11:51:59 +0200
From:	Richard Weinberger <richard@....at>
To:	Joel Reardon <joel@...mbassador.com>
CC:	Artem Bityutskiy <dedekind1@...il.com>,
	linux-mtd@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [patch] UBI: add means to clear ubi work queue for particular
 lnums

Am 13.05.2012 10:47, schrieb Joel Reardon:
> +int ubi_wl_flush_lnum(struct ubi_device *ubi, int lnum)
> +{
> +	int err = 0;
> +	struct ubi_work *wrk, *tmp;
> +
> +	/* For each pending work, if it corresponds to the parameter @lnum,
> +	 * then execute the work.
> +	 */
> +	dbg_wl("flush lnum %d", lnum);
> +	list_for_each_entry_safe(wrk, tmp, &ubi->works, list) {
> +		if (wrk->lnum == lnum) {
> +			spin_lock(&ubi->wl_lock);
> +			list_del(&wrk->list);
> +			ubi->works_count -= 1;
> +			ubi_assert(ubi->works_count >= 0);
> +			spin_unlock(&ubi->wl_lock);
> +
> +			err = wrk->func(ubi, wrk, 0);
> +			if (err)
> +				ubi_err("work failed with error code %d", err);
> +		}
> +	}
> +
> +	return err;
> +}

I think you also have to grab ubi->work_sem in read mode here.

Thanks,
//richard


Download attachment "signature.asc" of type "application/pgp-signature" (491 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ