diff options
author | Bhavesh Parekh <bparekh@nvidia.com> | 2011-11-30 07:13:42 -0500 |
---|---|---|
committer | Artem Bityutskiy <artem.bityutskiy@linux.intel.com> | 2011-11-30 07:13:42 -0500 |
commit | e801e128b2200c40a0ec236cf2330b2586b6e05a (patch) | |
tree | 2f348a09690fea8484d2a4310c1f979f8156b46a /drivers/mtd/ubi/eba.c | |
parent | eaecf43a6970c8d0ef54a31427c82a99e4863fe8 (diff) |
UBI: fix missing scrub when there is a bit-flip
Under some cases, when scrubbing the PEB if we did not get the lock on
the PEB it fails to scrub. Add that PEB again to the scrub list
Artem: minor amendments.
Cc: stable@kernel.org [2.6.31+]
Signed-off-by: Bhavesh Parekh <bparekh@nvidia.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Diffstat (limited to 'drivers/mtd/ubi/eba.c')
-rw-r--r-- | drivers/mtd/ubi/eba.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/mtd/ubi/eba.c b/drivers/mtd/ubi/eba.c index fb7f19b62d91..cd26da8ad225 100644 --- a/drivers/mtd/ubi/eba.c +++ b/drivers/mtd/ubi/eba.c | |||
@@ -1028,12 +1028,14 @@ int ubi_eba_copy_leb(struct ubi_device *ubi, int from, int to, | |||
1028 | * 'ubi_wl_put_peb()' function on the @ubi->move_mutex. In turn, we are | 1028 | * 'ubi_wl_put_peb()' function on the @ubi->move_mutex. In turn, we are |
1029 | * holding @ubi->move_mutex and go sleep on the LEB lock. So, if the | 1029 | * holding @ubi->move_mutex and go sleep on the LEB lock. So, if the |
1030 | * LEB is already locked, we just do not move it and return | 1030 | * LEB is already locked, we just do not move it and return |
1031 | * %MOVE_CANCEL_RACE, which means that UBI will re-try, but later. | 1031 | * %MOVE_RETRY. Note, we do not return %MOVE_CANCEL_RACE here because |
1032 | * we do not know the reasons of the contention - it may be just a | ||
1033 | * normal I/O on this LEB, so we want to re-try. | ||
1032 | */ | 1034 | */ |
1033 | err = leb_write_trylock(ubi, vol_id, lnum); | 1035 | err = leb_write_trylock(ubi, vol_id, lnum); |
1034 | if (err) { | 1036 | if (err) { |
1035 | dbg_wl("contention on LEB %d:%d, cancel", vol_id, lnum); | 1037 | dbg_wl("contention on LEB %d:%d, cancel", vol_id, lnum); |
1036 | return MOVE_CANCEL_RACE; | 1038 | return MOVE_RETRY; |
1037 | } | 1039 | } |
1038 | 1040 | ||
1039 | /* | 1041 | /* |