Re: [RFC / PATCH] mtd/ubi: flush wl before clearing update marker

Artem Bityutskiy
2009-11-30T12:52:04Z

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

This bug fix deserves being sent to Linus now, but it is now so late
that I'm really not sure I should do this, because if this causes any
regression, it will be too late to fix it for 2.6.32. So I think I'll
merge it to 2.6.33, is this OK with you?