From: Artem Bityutskiy <dedekind1@gmail.com>
To: Joel Reardon <joel@clambassador.com>
Cc: "linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
"linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] UBI: allow atomic updates to sychronously erase old PEB
Date: Wed, 11 Apr 2012 15:26:45 +0300 [thread overview]
Message-ID: <1334147205.13842.8.camel@sauron.fi.intel.com> (raw)
In-Reply-To: <alpine.DEB.2.00.1203301709080.10066@eristoteles.iwoars.net>
[-- Attachment #1: Type: text/plain, Size: 1574 bytes --]
Hi,
sorry for long delay.
First of all - please, make UBI and UBIFS changes in separate patches -
we consider these to be separate subsystems.
On Fri, 2012-03-30 at 17:11 +0200, Joel Reardon wrote:
> @@ -629,12 +628,13 @@ static int erase_worker(struct ubi_device *ubi, struct ubi_work *wl_wrk,
> * @ubi: UBI device description object
> * @e: the WL entry of the physical eraseblock to erase
> * @torture: if the physical eraseblock has to be tortured
> + * @sync: schedule the work immediately and return after completion
> *
> * This function returns zero in case of success and a %-ENOMEM in case of
> * failure.
> */
> static int schedule_erase(struct ubi_device *ubi, struct ubi_wl_entry *e,
> - int torture)
> + int torture, int sync)
> {
> struct ubi_work *wl_wrk;
>
> @@ -649,7 +649,11 @@ static int schedule_erase(struct ubi_device *ubi, struct ubi_wl_entry *e,
> wl_wrk->e = e;
> wl_wrk->torture = torture;
>
> - schedule_ubi_work(ubi, wl_wrk);
> + if (sync)
> + erase_worker(ubi, wl_wrk, 0);
> + else
> + schedule_ubi_work(ubi, wl_wrk);
> +
> return 0;
> }
Please, do not modify this function. You only need to do "if (sync)"
in 'ubi_wl_put_peb()' and nowhere else, so do it directly there.
You will have no "what if sync fails" issues then. Also, just from
common sense point of view, "schedule_erase" should schedule, not erase.
Otherwise looks good - I can take this to the ubifs tree straight
away even without your security stuff.
--
Best Regards,
Artem Bityutskiy
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2012-04-11 12:25 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-29 14:55 [PATCH] UBI: allow atomic updates to sychronously erase old PEB Joel Reardon
2012-03-29 16:24 ` Matthieu CASTET
2012-03-30 12:20 ` Joel Reardon
2012-03-30 12:28 ` Artem Bityutskiy
2012-03-30 12:33 ` Joel Reardon
2012-03-30 12:42 ` Artem Bityutskiy
2012-03-30 15:11 ` Joel Reardon
2012-04-11 12:26 ` Artem Bityutskiy [this message]
2012-04-11 13:14 ` Joel Reardon
2012-04-11 16:04 ` Artem Bityutskiy
2012-04-11 13:14 ` [PATCH] UBIFS: use ubi's new ubi_leb_change sync parameter Joel Reardon
2012-04-11 15:38 ` Joel Reardon
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=1334147205.13842.8.camel@sauron.fi.intel.com \
--to=dedekind1@gmail.com \
--cc=joel@clambassador.com \
--cc=linux-fsdevel@vger.kernel.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).