aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSong Liu <songliubraving@fb.com>2019-04-16 09:34:21 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-05-25 18:23:47 +0200
commit3d25b7f5c3be429c1b492258f17b7424f9c7fcaf (patch)
tree4df5ffef71cf150e48977f9f99a8acebd1c65aa0
parenta0b1dde1e68644bb39d13fbbe3d57f2cef38233a (diff)
downloadlinux-yocto-3d25b7f5c3be429c1b492258f17b7424f9c7fcaf.tar.gz
linux-yocto-3d25b7f5c3be429c1b492258f17b7424f9c7fcaf.tar.bz2
linux-yocto-3d25b7f5c3be429c1b492258f17b7424f9c7fcaf.zip
Revert "Don't jump to compute_result state from check_result state"
commit a25d8c327bb41742dbd59f8c545f59f3b9c39983 upstream. This reverts commit 4f4fd7c5798bbdd5a03a60f6269cf1177fbd11ef. Cc: Dan Williams <dan.j.williams@intel.com> Cc: Nigel Croxon <ncroxon@redhat.com> Cc: Xiao Ni <xni@redhat.com> Signed-off-by: Song Liu <songliubraving@fb.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/md/raid5.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 828d86605fb6..ae38895c44b2 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -4221,15 +4221,26 @@ static void handle_parity_checks6(struct r5conf *conf, struct stripe_head *sh,
case check_state_check_result:
sh->check_state = check_state_idle;
- if (s->failed > 1)
- break;
/* handle a successful check operation, if parity is correct
* we are done. Otherwise update the mismatch count and repair
* parity if !MD_RECOVERY_CHECK
*/
if (sh->ops.zero_sum_result == 0) {
- /* Any parity checked was correct */
- set_bit(STRIPE_INSYNC, &sh->state);
+ /* both parities are correct */
+ if (!s->failed)
+ set_bit(STRIPE_INSYNC, &sh->state);
+ else {
+ /* in contrast to the raid5 case we can validate
+ * parity, but still have a failure to write
+ * back
+ */
+ sh->check_state = check_state_compute_result;
+ /* Returning at this point means that we may go
+ * off and bring p and/or q uptodate again so
+ * we make sure to check zero_sum_result again
+ * to verify if p or q need writeback
+ */
+ }
} else {
atomic64_add(STRIPE_SECTORS, &conf->mddev->resync_mismatches);
if (test_bit(MD_RECOVERY_CHECK, &conf->mddev->recovery)) {