]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
md/bitmap: don't read page from device with Bitmap_sync
authorGuoqing Jiang <gqjiang@suse.com>
Tue, 4 Jul 2017 03:20:30 +0000 (11:20 +0800)
committerShaohua Li <shli@fb.com>
Mon, 10 Jul 2017 17:30:41 +0000 (10:30 -0700)
The device owns Bitmap_sync flag needs recovery
to become in sync, and read page from this type
device could get stale status.

Also add comments for Bitmap_sync bit per the
suggestion from Shaohua and Neil.

Previous disscussion can be found here:
https://marc.info/?t=149760428900004&r=1&w=2

Signed-off-by: Guoqing Jiang <gqjiang@suse.com>
Signed-off-by: Shaohua Li <shli@fb.com>
drivers/md/bitmap.c
drivers/md/md.h

index f4eace5ea184095eb0c170c4f3f1647f72b8c537..40f3cd7eab0fc69ef0ea3e79efa079a33fc78aaf 100644 (file)
@@ -156,7 +156,8 @@ static int read_sb_page(struct mddev *mddev, loff_t offset,
 
        rdev_for_each(rdev, mddev) {
                if (! test_bit(In_sync, &rdev->flags)
-                   || test_bit(Faulty, &rdev->flags))
+                   || test_bit(Faulty, &rdev->flags)
+                   || test_bit(Bitmap_sync, &rdev->flags))
                        continue;
 
                target = offset + index * (PAGE_SIZE/512);
index 991f0fe2dcc684a7f0cb2c5c51902b3dc9a19af8..b50eb4ac1b8291444e1af5196b44f5c7da368842 100644 (file)
@@ -134,7 +134,9 @@ enum flag_bits {
        Faulty,                 /* device is known to have a fault */
        In_sync,                /* device is in_sync with rest of array */
        Bitmap_sync,            /* ..actually, not quite In_sync.  Need a
-                                * bitmap-based recovery to get fully in sync
+                                * bitmap-based recovery to get fully in sync.
+                                * The bit is only meaningful before device
+                                * has been passed to pers->hot_add_disk.
                                 */
        WriteMostly,            /* Avoid reading if at all possible */
        AutoDetected,           /* added by auto-detect */