From: Richard Weinberger <richard@nod.at>
To: Joel Reardon <joel@clambassador.com>
Cc: linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org,
Artem Bityutskiy <dedekind1@gmail.com>
Subject: Re: [patch] UBI: add means to clear ubi work queue for particular lnums
Date: Sun, 13 May 2012 11:51:59 +0200 [thread overview]
Message-ID: <4FAF843F.2010704@nod.at> (raw)
In-Reply-To: <alpine.DEB.2.00.1205131043370.654@eristoteles.iwoars.net>
[-- Attachment #1: Type: text/plain, Size: 823 bytes --]
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
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 490 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: Richard Weinberger <richard@nod.at>
To: Joel Reardon <joel@clambassador.com>
Cc: Artem Bityutskiy <dedekind1@gmail.com>,
linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [patch] UBI: add means to clear ubi work queue for particular lnums
Date: Sun, 13 May 2012 11:51:59 +0200 [thread overview]
Message-ID: <4FAF843F.2010704@nod.at> (raw)
In-Reply-To: <alpine.DEB.2.00.1205131043370.654@eristoteles.iwoars.net>
[-- Attachment #1: Type: text/plain, Size: 823 bytes --]
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
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 490 bytes --]
next prev parent reply other threads:[~2012-05-13 9:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-12 15:15 [patch] UBI: add lnum to ubi_work data structure Joel Reardon
2012-05-13 8:47 ` [patch] UBI: add means to clear ubi work queue for particular lnums Joel Reardon
2012-05-13 9:51 ` Richard Weinberger [this message]
2012-05-13 9:51 ` Richard Weinberger
2012-05-14 17:14 ` Artem Bityutskiy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4FAF843F.2010704@nod.at \
--to=richard@nod.at \
--cc=dedekind1@gmail.com \
--cc=joel@clambassador.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.