raid5-ppl: check recovery_offset when performing ppl recovery
authorArtur Paszkiewicz <artur.paszkiewicz@intel.com>
Fri, 29 Sep 2017 20:54:19 +0000 (22:54 +0200)
committerShaohua Li <shli@fb.com>
Tue, 17 Oct 2017 02:06:34 +0000 (19:06 -0700)
If starting an array that is undergoing rebuild, make ppl recovery honor
the recovery_offset of a member disk and don't read data that is not yet
in-sync.

Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Signed-off-by: Shaohua Li <shli@fb.com>
drivers/md/raid5-ppl.c

index 76d6245..628c0bf 100644 (file)
@@ -758,7 +758,8 @@ static int ppl_recover_entry(struct ppl_log *log, struct ppl_header_entry *e,
                                 (unsigned long long)sector);
 
                        rdev = conf->disks[dd_idx].rdev;
-                       if (!rdev) {
+                       if (!rdev || (!test_bit(In_sync, &rdev->flags) &&
+                                     sector >= rdev->recovery_offset)) {
                                pr_debug("%s:%*s data member disk %d missing\n",
                                         __func__, indent, "", dd_idx);
                                update_parity = false;