summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/mtdsuper.c
diff options
context:
space:
mode:
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2009-05-12 15:43:44 +0300
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2009-05-18 12:28:25 +0300
commitffb6b7e4fdef715061859651fe46cd27afc6acec (patch)
tree7b01298488f897b1176fc405fa8b4813f50ebf7b /drivers/mtd/mtdsuper.c
parent2cb81e218f336dc5438a960d1ae098188db9ff11 (diff)
UBI: fix races in I/O debugging checks
When paranoid checs are enabled, the 'io_paral' test from the 'mtd-utils' package fails. The symptoms are: UBI error: paranoid_check_all_ff: flash region at PEB 3973:512, length 15872 does not contain all 0xFF bytes UBI error: paranoid_check_all_ff: paranoid check failed for PEB 3973 UBI: hex dump of the 512-16384 region It turned out to be a bug in the checking function. Suppose there are 2 tasks - A and B. Task A is the wear-levelling working ('wear_leveling_worker()'). It is reading the VID header to find which LEB this PEB belongs to. Say, task A is reading header of PEB X. Suppose PEB X is unmapped, and has no VID header. Task B is trying to write to PEB X. Task A: in 'ubi_io_read_vid_hdr()': reads the VID header from PEB X. The read data contain all 0xFF bytes. Task B: writes VID header and some data to PEB X Task A: assumes PEB X is empty, calls 'paranoid_check_all_ff()', which fails. The solution for this problem is to make 'paranoid_check_all_ff()' re-read the VID header, re-check it, and only if it is not there, check the rest. This now implemented by the 'paranoid_check_empty()' function. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'drivers/mtd/mtdsuper.c')
0 files changed, 0 insertions, 0 deletions