]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/5.0.19/revert-don-t-jump-to-compute_result-state-from-check_result-state.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 5.0.19 / revert-don-t-jump-to-compute_result-state-from-check_result-state.patch
CommitLineData
b8704eb5
GKH
1From a25d8c327bb41742dbd59f8c545f59f3b9c39983 Mon Sep 17 00:00:00 2001
2From: Song Liu <songliubraving@fb.com>
3Date: Tue, 16 Apr 2019 09:34:21 -0700
4Subject: Revert "Don't jump to compute_result state from check_result state"
5
6From: Song Liu <songliubraving@fb.com>
7
8commit a25d8c327bb41742dbd59f8c545f59f3b9c39983 upstream.
9
10This reverts commit 4f4fd7c5798bbdd5a03a60f6269cf1177fbd11ef.
11
12Cc: Dan Williams <dan.j.williams@intel.com>
13Cc: Nigel Croxon <ncroxon@redhat.com>
14Cc: Xiao Ni <xni@redhat.com>
15Signed-off-by: Song Liu <songliubraving@fb.com>
16Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
17
18---
19 drivers/md/raid5.c | 19 +++++++++++++++----
20 1 file changed, 15 insertions(+), 4 deletions(-)
21
22--- a/drivers/md/raid5.c
23+++ b/drivers/md/raid5.c
24@@ -4233,15 +4233,26 @@ static void handle_parity_checks6(struct
25 case check_state_check_result:
26 sh->check_state = check_state_idle;
27
28- if (s->failed > 1)
29- break;
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
33 */
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 */
38+ if (!s->failed)
39+ set_bit(STRIPE_INSYNC, &sh->state);
40+ else {
41+ /* in contrast to the raid5 case we can validate
42+ * parity, but still have a failure to write
43+ * back
44+ */
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
50+ */
51+ }
52 } else {
53 atomic64_add(STRIPE_SECTORS, &conf->mddev->resync_mismatches);
54 if (test_bit(MD_RECOVERY_CHECK, &conf->mddev->recovery)) {