1 From a25d8c327bb41742dbd59f8c545f59f3b9c39983 Mon Sep 17 00:00:00 2001
2 From: Song Liu <songliubraving@fb.com>
3 Date: Tue, 16 Apr 2019 09:34:21 -0700
4 Subject: Revert "Don't jump to compute_result state from check_result state"
6 From: Song Liu <songliubraving@fb.com>
8 commit a25d8c327bb41742dbd59f8c545f59f3b9c39983 upstream.
10 This reverts commit 4f4fd7c5798bbdd5a03a60f6269cf1177fbd11ef.
12 Cc: Dan Williams <dan.j.williams@intel.com>
13 Cc: Nigel Croxon <ncroxon@redhat.com>
14 Cc: Xiao Ni <xni@redhat.com>
15 Signed-off-by: Song Liu <songliubraving@fb.com>
16 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
19 drivers/md/raid5.c | 19 +++++++++++++++----
20 1 file changed, 15 insertions(+), 4 deletions(-)
22 --- a/drivers/md/raid5.c
23 +++ b/drivers/md/raid5.c
24 @@ -3897,15 +3897,26 @@ static void handle_parity_checks6(struct
25 case check_state_check_result:
26 sh->check_state = check_state_idle;
30 /* handle a successful check operation, if parity is correct
31 * we are done. Otherwise update the mismatch count and repair
32 * parity if !MD_RECOVERY_CHECK
34 if (sh->ops.zero_sum_result == 0) {
35 - /* Any parity checked was correct */
36 - set_bit(STRIPE_INSYNC, &sh->state);
37 + /* both parities are correct */
39 + set_bit(STRIPE_INSYNC, &sh->state);
41 + /* in contrast to the raid5 case we can validate
42 + * parity, but still have a failure to write
45 + sh->check_state = check_state_compute_result;
46 + /* Returning at this point means that we may go
47 + * off and bring p and/or q uptodate again so
48 + * we make sure to check zero_sum_result again
49 + * to verify if p or q need writeback
53 atomic64_add(STRIPE_SECTORS, &conf->mddev->resync_mismatches);
54 if (test_bit(MD_RECOVERY_CHECK, &conf->mddev->recovery))