[UBI] Missing scrub when there is a bit-flip
Artem Bityutskiy
dedekind1 at gmail.com
Tue Nov 29 17:15:46 EST 2011
Hi, good catch!
On Wed, 2011-11-23 at 18:58 +0530, Bhavesh Parekh wrote:
... snip ...
> When we used leb_write_lock instead of leb_write_trylock() then we are
> seeing matching erase-call for the bit-flips.
>
> So, we are currently thinking 2 possible approaches to fix this:
> 1. Use leb_write_lock instead of leb_write_trylock(), but
> leb_write_trylock was used to avoid contention. Will adding back will
> have side-effect ?
Yeah, there is a big comment which explains that this can cause a
dead-lock, so you cannot use leb_write_lock().
> 2. Add the leb again in the scrubbing list for scrubbing. There is
> already code for the same in the implementation, (in out_not_moved
> case where scrubbed=1 if condition), but since we have set protect=1
> we won't go in this condition. We are thinking to return two
> different error code from the eba_copy_leb base for two different
> cases in the function (one where volume is removed and another is
> contention). And only in case of contention set scrubbing=1 and call
> goto out_not_moved which will add this LEB for scrubbing again.
Yes, this sounds reasonable, introduce a separate return code, like
MOVE_RETRY. Please go ahead and send a patch.
Thanks!
More information about the linux-mtd
mailing list