Skip to contentSkip to conversation

Two fixes for PPL recovery

PATCH Applied Artur Paszkiewicz 2 participants 4 messages Sep 29, 2017 – Sep 30, 2017 MD RAID

lore
Share & tools
lore
#0 lore raw

cover Two fixes for PPL recovery

These patches fix some issues that can occur when array rebuild starts after ppl recovery.

Artur Paszkiewicz (2):
raid5-ppl: don't resync after rebuild
raid5-ppl: check recovery_offset when performing ppl recovery

 drivers/md/raid5-ppl.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
Signature · 1 line
2.14.1
#1 lore raw

PATCH 1/2 raid5-ppl: don't resync after rebuild

The check for degraded array is unnecessary and causes a resync to be performed after ppl recovery and rebuild when restarting an array during rebuilding after unclean shutdown.

---
 drivers/md/raid5-ppl.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/md/raid5-ppl.c +1 -2
index a98ef172f8e8..2c6513777f68 100644
@@ -1296,8 +1296,7 @@ int ppl_init_log(struct r5conf *conf)
 
 	if (ret) {
 		goto err;
-	} else if (!mddev->pers &&
-		   mddev->recovery_cp == 0 && !mddev->degraded &&
+	} else if (!mddev->pers && mddev->recovery_cp == 0 &&
 		   ppl_conf->recovered_entries > 0 &&
 		   ppl_conf->mismatch_count == 0) {
 		/*
Signature · 1 line
2.14.1
#2 lore raw

PATCH 2/2 raid5-ppl: check recovery_offset when performing ppl recovery

In reply to Artur Paszkiewicz

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.

---
 drivers/md/raid5-ppl.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/md/raid5-ppl.c +2 -1
index 2c6513777f68..c3e1899d5986 100644
@@ -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;
Signature · 1 line
2.14.1
Applied
#3 lore raw
In reply to Artur Paszkiewicz
Quoted 6 lines · Artur Paszkiewicz

These patches fix some issues that can occur when array rebuild starts after ppl recovery.

Artur Paszkiewicz (2):
raid5-ppl: don't resync after rebuild
raid5-ppl: check recovery_offset when performing ppl recovery

applied, thanks!

Quoted 10 lines
 drivers/md/raid5-ppl.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
Signature · 6 lines
2.14.1

--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html