linux/drivers/mtd/ubi
Artem Bityutskiy ffb6b7e4fd 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>
2009-05-18 12:28:25 +03:00
..
Kconfig UBI: improve Kconfig documentation 2008-04-17 11:32:00 +03:00
Kconfig.debug UBI: allow direct user-space I/O 2009-01-27 16:54:41 +02:00
Makefile UBI: Unsorted Block Images 2007-04-27 14:23:33 +03:00
build.c UBI: small debugging code optimization 2009-05-18 12:28:25 +03:00
cdev.c UBI: improve debugging messages 2009-05-18 12:28:25 +03:00
debug.c UBI: remove pre-sqnum images support 2008-07-24 13:36:09 +03:00
debug.h UBI: fix checkpatch.pl warnings 2008-12-28 12:20:51 +02:00
eba.c trivial: fix then -> than typos in comments and documentation 2009-01-06 11:28:06 +01:00
gluebi.c UBI: use nicer 64-bit math 2009-01-18 14:27:44 +02:00
io.c UBI: fix races in I/O debugging checks 2009-05-18 12:28:25 +03:00
kapi.c UBI: improve debugging messages 2009-05-18 12:28:25 +03:00
misc.c UBI: avoid unnecessary division operations 2008-07-24 13:32:54 +03:00
scan.c UBI: use nicer 64-bit math 2009-01-18 14:27:44 +02:00
scan.h UBI: remove pre-sqnum images support 2008-07-24 13:36:09 +03:00
ubi-media.h trivial: fix then -> than typos in comments and documentation 2009-01-06 11:28:06 +01:00
ubi.h UBI: small debugging code optimization 2009-05-18 12:28:25 +03:00
upd.c UBI: re-name volumes_mutex to device_mutex 2009-05-18 12:28:24 +03:00
vmt.c UBI: improve debugging messages 2009-05-18 12:28:25 +03:00
vtbl.c trivial: fix then -> than typos in comments and documentation 2009-01-06 11:28:06 +01:00
wl.c trivial: fix then -> than typos in comments and documentation 2009-01-06 11:28:06 +01:00