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=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham 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 2E682C10F14 for ; Thu, 3 Oct 2019 16:47:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F110C2086A for ; Thu, 3 Oct 2019 16:47:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570121274; bh=55epLifv/9ypt2pWBrwbCrVU96q+XbcR0MUL9tS6NaA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=Il8hVvOl1r7tvAHziC3OsnKdFOAA2Uq9OLFY15qLw60u0j1/CrUEJHE849gxxSa+g O2oTV5EGU4BI5bH+3qwhAZ6udCPRn44fgNqRxCPoZZHrqQVfTOvxAhLPFp+/MmuLIh luYk34X9UCEf7X9lDPNfLvGnKoi4KZQMn3MYy09o= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2393027AbfJCQrx (ORCPT ); Thu, 3 Oct 2019 12:47:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:33352 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405562AbfJCQrv (ORCPT ); Thu, 3 Oct 2019 12:47:51 -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 B22A320865; Thu, 3 Oct 2019 16:47:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570121270; bh=55epLifv/9ypt2pWBrwbCrVU96q+XbcR0MUL9tS6NaA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=baenF1i5cRwXxhI53RbR/Dm5BmLOc07hwWmZd6X06oagWYm0siYFn1gYI9TWlUBQv 1NqL81gO6FTwGjE8+cOriLgnUwg345aV2he/M5yhLYrvQ0GRTDArzaiAQuKHdMVtcx bIiytLmlV9CCPU4xy3SotNjS1c6DQra91nsk2KHM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nigel Croxon , Song Liu , Sasha Levin Subject: [PATCH 5.3 216/344] raid5: dont increment read_errors on EILSEQ return Date: Thu, 3 Oct 2019 17:53:01 +0200 Message-Id: <20191003154601.614207562@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191003154540.062170222@linuxfoundation.org> References: <20191003154540.062170222@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: Nigel Croxon [ Upstream commit b76b4715eba0d0ed574f58918b29c1b2f0fa37a8 ] While MD continues to count read errors returned by the lower layer. If those errors are -EILSEQ, instead of -EIO, it should NOT increase the read_errors count. When RAID6 is set up on dm-integrity target that detects massive corruption, the leg will be ejected from the array. Even if the issue is correctable with a sector re-write and the array has necessary redundancy to correct it. The leg is ejected because it runs up the rdev->read_errors beyond conf->max_nr_stripes. The return status in dm-drypt when there is a data integrity error is -EILSEQ (BLK_STS_PROTECTION). Signed-off-by: Nigel Croxon Signed-off-by: Song Liu Signed-off-by: Sasha Levin --- drivers/md/raid5.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index 21514edb2bea3..d574701185db9 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c @@ -2526,7 +2526,8 @@ static void raid5_end_read_request(struct bio * bi) int set_bad = 0; clear_bit(R5_UPTODATE, &sh->dev[i].flags); - atomic_inc(&rdev->read_errors); + if (!(bi->bi_status == BLK_STS_PROTECTION)) + atomic_inc(&rdev->read_errors); if (test_bit(R5_ReadRepl, &sh->dev[i].flags)) pr_warn_ratelimited( "md/raid:%s: read error on replacement device (sector %llu on %s).\n", -- 2.20.1