public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Artem Bityutskiy <dedekind@infradead.org>
To: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
Cc: linux-mtd@lists.infradead.org
Subject: Re: [RFC / PATCH] mtd/ubi: flush wl before clearing update marker
Date: Mon, 30 Nov 2009 14:50:16 +0200	[thread overview]
Message-ID: <1259585416.7518.106.camel@localhost> (raw)
In-Reply-To: <20091129184602.GB30617@Chamillionaire.breakpoint.cc>

On Sun, 2009-11-29 at 19:46 +0100, Sebastian Andrzej Siewior wrote:
> ubiupdatevol -t does the following:
> - ubi_start_update()
>   - set_update_marker()
>   - for all LEBs ubi_eba_unmap_leb()
>   - clear_update_marker()
>   - ubi_wl_flush()
> 
> ubi_wl_flush() physically erases all PEB, once it returns all PEBs are
> empty. clear_update_marker() has the update marker written after return.
> If there is a power cut between the last two functions then the UBI
> volume has no longer the "update" marker set and may have some valid
> LEBs while some of them may be gone.
> If that volume in question happens to be a UBIFS volume, then mount
> will fail with

Very good catch, thanks. Pushed to the ubi-2.6.git tree, although I've

[snip]

>  	if (bytes == 0) {
> +
Removed this junk newline
> +		err = ubi_wl_flush(ubi);
> +		if (err)
> +			return err;

[snip]

>  	vol->upd_buf = vmalloc(ubi->leb_size);
> @@ -362,16 +365,17 @@ int ubi_more_update_data(struct ubi_device *ubi, struct ubi_volume *vol,
>  
>  	ubi_assert(vol->upd_received <= vol->upd_bytes);
>  	if (vol->upd_received == vol->upd_bytes) {
> +
And this.
> +		err = ubi_wl_flush(ubi);
> +		if (err)
> +			return err;

[snip]

-- 
Best Regards,
Artem Bityutskiy (Артём Битюцкий)

  reply	other threads:[~2009-11-30 13:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-29 18:46 [RFC / PATCH] mtd/ubi: flush wl before clearing update marker Sebastian Andrzej Siewior
2009-11-30 12:50 ` Artem Bityutskiy [this message]
2009-11-30 12:51 ` Artem Bityutskiy
2009-12-01 23:30   ` Sebastian Andrzej Siewior
2009-12-02  6:36     ` 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=1259585416.7518.106.camel@localhost \
    --to=dedekind@infradead.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=sebastian@breakpoint.cc \
    /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