From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.0 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,T_DKIMWL_WL_HIGH,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 68DB8C282E1 for ; Thu, 23 May 2019 19:36:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 36F0820879 for ; Thu, 23 May 2019 19:36:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1558640178; bh=fMNabywZwRptobfNiTirh8DZlaNDhc36jU1gCIM/fbc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=UFOYei0EBf++2FdWxexvCpD2o+ykc0pgUe8w6Q0GBPFxzEJZOFo2XGn75Zx1R8+4y evgZ7ToqWsjqzleiEtsyo7GQRfD2OiLmKIHe+4KH5CN+vlEnAinIgky0vFT4jtJxfi hDP7JWG6cQxqw25x93VuHDDJd6QG4/MmRE1VLU1I= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391176AbfEWTZv (ORCPT ); Thu, 23 May 2019 15:25:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:37364 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391161AbfEWTZn (ORCPT ); Thu, 23 May 2019 15:25:43 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id AE91A217D9; Thu, 23 May 2019 19:25:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1558639543; bh=fMNabywZwRptobfNiTirh8DZlaNDhc36jU1gCIM/fbc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ah7IULWz/TuSiGQfG/YV35FoRhqyHYb3m0vpJEg7pCpOK57dC928eEpKDFCaj9EYt XhMN3D63gn/FWPiTzit49piXiqaYWv/Uh6x5jNh+qk1ucJ//IsoYgnnxdJmm1bGLw2 Qt+crg3mhNGaxe6z/9QP5vk35G9s5g8HNbzn04EM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Williams , Nigel Croxon , Xiao Ni , Song Liu Subject: [PATCH 5.0 134/139] Revert "Dont jump to compute_result state from check_result state" Date: Thu, 23 May 2019 21:07:02 +0200 Message-Id: <20190523181736.421439197@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190523181720.120897565@linuxfoundation.org> References: <20190523181720.120897565@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Song Liu commit a25d8c327bb41742dbd59f8c545f59f3b9c39983 upstream. This reverts commit 4f4fd7c5798bbdd5a03a60f6269cf1177fbd11ef. Cc: Dan Williams Cc: Nigel Croxon Cc: Xiao Ni Signed-off-by: Song Liu Signed-off-by: Greg Kroah-Hartman --- drivers/md/raid5.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c @@ -4233,15 +4233,26 @@ static void handle_parity_checks6(struct 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)) {