]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
UBI: add a comment
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Tue, 20 May 2008 06:54:02 +0000 (09:54 +0300)
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Thu, 24 Jul 2008 10:32:54 +0000 (13:32 +0300)
It is not clear why we schedule PEB for scrubbing in case of
-EBADMSG. Elaborate.

Requested-by: Kyungmin Park <kmpark@infradead.org>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
drivers/mtd/ubi/vtbl.c

index 3c4d68f2cfd43da589ee489deb793c3e50786522..42a7815086b7fe3abc28e701607716e3bc106e62 100644 (file)
@@ -385,7 +385,16 @@ static struct ubi_vtbl_record *process_lvol(struct ubi_device *ubi,
                err = ubi_io_read_data(ubi, leb[seb->lnum], seb->pnum, 0,
                                       ubi->vtbl_size);
                if (err == UBI_IO_BITFLIPS || err == -EBADMSG)
-                       /* Scrub the PEB later */
+                       /*
+                        * Scrub the PEB later. Note, -EBADMSG indicates an
+                        * uncorrectable ECC error, but we have our own CRC and
+                        * the data will be checked later. If the data is OK,
+                        * the PEB will be scrubbed (because we set
+                        * seb->scrub). If the data is not OK, the contents of
+                        * the PEB will be recovered from the second copy, and
+                        * seb->scrub will be cleared in
+                        * 'ubi_scan_add_used()'.
+                        */
                        seb->scrub = 1;
                else if (err)
                        goto out_free;