Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2490305pxj; Mon, 10 May 2021 04:21:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyg+YNjwgLjfQ70xz+IniNT/kzqFmNct9Zoxq5e4+q8T9LFGwQOUq+yNJUiJELNbe0ojYrL X-Received: by 2002:a05:6402:1807:: with SMTP id g7mr28453982edy.335.1620645708792; Mon, 10 May 2021 04:21:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620645708; cv=none; d=google.com; s=arc-20160816; b=mjSFnKCOBgeob8w+cLHIjpjROBUjm7FzAYpfrPIQiEKnZhRPtNaI7tPMTQ1W00eEdM ySwfW4/7FBnoslS3hQ0nqQQcp67l/N2a1kxpvOY34V9rm8f5TQ+sb2eNsuFCK0vQlh6X GKB6MarXnbLiAIVDBcONJuUrLS/rAN0BlSGy8Rp7YNIEUN+CZMO7mZyiuD1otnheigB0 Fu7SzjuhJqcpchJhOQVX/A0xHEsnxY5WfSRDy/d1gWK1SPgE5EbIW7yzfty9vxdSGXV5 /jkdw6IngPM+VmBIe8ww+gc35FuWa11E6EWLjCRfDglDAG0+5cllbPeNSqKjGjvohJ6D InhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=pEz7QxI8HuplxbjCEDrmC2lmtTP9sMr/vMPZMecBNkI=; b=qw7IxmwAiXorMg3U98QhYTgd3Dl1QWETu1nrPNzcPp/wbwSumCrjMfKFhej9/HuOog CfkpwptWt7iWOAveVUUrd9AOVuL86C9kcYHdlNCFFgUr8eO4weFRhp166uqxX6XEeekB NJIp2XY0UVLenNdBbI27+j0zZ8fbl0qGNRFDkxt+RnWDjs8fvpeUMk2qC2+X58iJvGm2 Vnr2wE1dvcQsFaw+nAMPQwgGNHsUIvD2yfz8aUmgPKP467xjuIg4FK9EPqlCIOctGm0T 3hq+EQphr84o9U9B79Lju3ctlNN0ResfXrYhXs87Ag8uBosXygtZluqECHbabaUOD3Bz 5fVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="oXr5/D/Z"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w6si13573838edq.494.2021.05.10.04.21.25; Mon, 10 May 2021 04:21:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="oXr5/D/Z"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238150AbhEJLRK (ORCPT + 99 others); Mon, 10 May 2021 07:17:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:41986 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232403AbhEJKw3 (ORCPT ); Mon, 10 May 2021 06:52:29 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0A9A261C19; Mon, 10 May 2021 10:41:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620643273; bh=29DoPG3qtHfvm9IGlve0Xe329ZBTFbZ0k6Oc7+oTeas=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oXr5/D/ZMX0EbHPEdMGB6dwAMDhqFHkVJjRpB7enchlrnpCwmsyhcqaTm3k3vbE1t /EVWbO8etICDocaAzCHEOWPfWNrf6lVcHsQGzAVba/Kyc29FzSYS7iq6GYf9G8t7Y2 LoN/a2ee8YKtZOC94g//fxeUBZbw/zpVD1KzomUU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Paul Clements , Song Liu Subject: [PATCH 5.10 249/299] md/raid1: properly indicate failure when ending a failed write request Date: Mon, 10 May 2021 12:20:46 +0200 Message-Id: <20210510102013.184628598@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210510102004.821838356@linuxfoundation.org> References: <20210510102004.821838356@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Paul Clements commit 2417b9869b81882ab90fd5ed1081a1cb2d4db1dd upstream. This patch addresses a data corruption bug in raid1 arrays using bitmaps. Without this fix, the bitmap bits for the failed I/O end up being cleared. Since we are in the failure leg of raid1_end_write_request, the request either needs to be retried (R1BIO_WriteError) or failed (R1BIO_Degraded). Fixes: eeba6809d8d5 ("md/raid1: end bio when the device faulty") Cc: stable@vger.kernel.org # v5.2+ Signed-off-by: Paul Clements Signed-off-by: Song Liu Signed-off-by: Greg Kroah-Hartman --- drivers/md/raid1.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c @@ -478,6 +478,8 @@ static void raid1_end_write_request(stru if (!test_bit(Faulty, &rdev->flags)) set_bit(R1BIO_WriteError, &r1_bio->state); else { + /* Fail the request */ + set_bit(R1BIO_Degraded, &r1_bio->state); /* Finished with this branch */ r1_bio->bios[mirror] = NULL; to_put = bio;