md-cluster: don't update recovery_offset for faulty device
authorGuoqing Jiang <gqjiang@suse.com>
Mon, 9 Apr 2018 09:01:21 +0000 (17:01 +0800)
committerShaohua Li <shli@fb.com>
Mon, 9 Apr 2018 15:39:36 +0000 (08:39 -0700)
Device could become faulty when clustered array handling
METADATA_UPDATED msg, so we don't need to call read_rdev
for this device.

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

index 3bea45e..c208c01 100644 (file)
@@ -9256,8 +9256,10 @@ void md_reload_sb(struct mddev *mddev, int nr)
        check_sb_changes(mddev, rdev);
 
        /* Read all rdev's to update recovery_offset */
-       rdev_for_each_rcu(rdev, mddev)
-               read_rdev(mddev, rdev);
+       rdev_for_each_rcu(rdev, mddev) {
+               if (!test_bit(Faulty, &rdev->flags))
+                       read_rdev(mddev, rdev);
+       }
 }
 EXPORT_SYMBOL(md_reload_sb);