Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp73269ybp; Thu, 3 Oct 2019 10:20:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqwHyf5diX/U85SbU8FmBVL0903+RIsGlJAAbr7yq7XUTsA+a3C43IlpbeHQAZsY2F6YFth/ X-Received: by 2002:aa7:dc4b:: with SMTP id g11mr10885923edu.70.1570123233026; Thu, 03 Oct 2019 10:20:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570123233; cv=none; d=google.com; s=arc-20160816; b=FUobhbs/byWoethD0sNMajnfwzn9EoBKOLoHZ0LCK9CkDhI9mAjMOj330fU/524hDK jcNBFu3ckSH88BRSz2Igyn1s+BQyh6Gys3IQD6NGl5CFqyK5cLU9duwpZ+SiFDMgBifM ntEIbClNyjmmmkan/4WNJTRHGdAUb2SktNNifUh8d4AJYxlrbHrj9e195qeGYqvOLbfG oypbWP/pQTT/0Zih/rtS7eVlLLY7aB/d7G/T6Z0wnIA681WCBC5oi3XziCBoINH7EB2J 4OoCkFGDfcIGeCjj+dBEUq+K5mE3Dwn0unH5J3wsJ7bPMKJ5QkhKOczSTKCSbAHzsnoz T/Gg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=6IESkXltXKtXIOm8ya5TEh5P7Z2vFQ/OKyI1LD7+274=; b=UG+IYgc+vvPLHHPH+FwQmRPzl0cXIgYkLbSwYhcc8Aml/cT9uI0RG0MpER4JS++TcZ IEQbN/57vm43/MhhJLu8zzSPK4JNAVXFfuu/BkdvxOprhMff5TXIPsxDuVNNetGo1ZRV DA4FsLLR4njhKasWpqwZUqJy3JAfw9LxN15/jSz0/IPCsmBcyVLW+K5nQH734El9UKOn jo1eQ+MFM99BKOyBJ900uwqerNpC4ADqDtKqAo9rXXId+hK//TxhthJB6Wsz73H/laF+ pLfUZJW79b179NtkOabiy+3DhTPyBIR/pIi15DSMkUVJewr5gpZw4VL6K5jIiEv40IFz jB2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=rl1FRkX2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 2si1756079ejq.243.2019.10.03.10.20.08; Thu, 03 Oct 2019 10:20:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=rl1FRkX2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389952AbfJCQUj (ORCPT + 99 others); Thu, 3 Oct 2019 12:20:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:48386 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389940AbfJCQUg (ORCPT ); Thu, 3 Oct 2019 12:20:36 -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 474B420865; Thu, 3 Oct 2019 16:20:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570119635; bh=K+q3mHnwRmnhbB9RNRwxP3slO8LmOvrVsRKDXNrA6zk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rl1FRkX2ZlMyYuJLh9+MX2X1SFU8t2CXsufUj/tY4YBvPcEfENiWnzG6jGhZlhS8u xxt3QU7l2a2FpGTpVibfMfSWEwY4GVWEK3jI5LI5JjqQgnvRdY1olIVCEpONjh8F6O vdD/SDykhHhZiJo4IcSDopAUkYJGi9rTOtyfha18= 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 4.19 137/211] raid5: dont increment read_errors on EILSEQ return Date: Thu, 3 Oct 2019 17:53:23 +0200 Message-Id: <20191003154518.443511325@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191003154447.010950442@linuxfoundation.org> References: <20191003154447.010950442@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 d26e5e9bea427..dbc4655a95768 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c @@ -2540,7 +2540,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