Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp3768529pxt; Tue, 10 Aug 2021 10:53:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwAL9Etl+O2WRhlfKdVjLyYPQI8GAvAAtjqhhuTFkgl2D1CAfDMdDTl2FylHKeJQLxoLMjf X-Received: by 2002:a92:d304:: with SMTP id x4mr220ila.82.1628617986602; Tue, 10 Aug 2021 10:53:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628617986; cv=none; d=google.com; s=arc-20160816; b=m3XEziTfOGNrBFx8iVc2Wj5I6C0BlHN+QkwxbpSez9ZVPdMO1DRLwLO/Gi/LYUAB2u aYC9B5fCPtWCSOcOtpA1pD9uzcVFH+JiIOCBrClrC9/AG78h4DGrs2+hTl2GFSFK+6/6 J0McATej18l2+cjjsHEVaAOFq7385xkL6ylJEunxUVIXEY1zJXavI9xSZp8r7NCUdv0v LSE8Q86x5OdSeNbzr5vapKPJgpCP3jeMljFCNBe9XKVGhkn1XWQASJJISLspRiK73tAr fHT5WT/d0AaDPUHuQotumBEb9W7Pk0AXQESx7Z3SC+Puzl9phHIn5O0ycmGhdn4egIWU Lqpw== 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=yOfqw2EiARR1yCV6xkX/fr6FLVN5wfXShjFoABLLruo=; b=o5dmE1Xmrql4LgEU79mNaZYmBq0M8UVSIJL3vR30j98sSP3ZxOL2lsFj3qfjbKxk6r rHS4x82a+BN3OihAdX9RfTlvFicO6gZnv+CFxCeynW1wOrl/4TU6LuzkNTk3FiMqZp5C wjqlS/kDVrBHeIQ+KmppxnlgB3ON5q/XBfaggwNfFgNbGZaCRJLTw++xaJej6uxGk/ch Pzv3DxqKklps1CgYN16qFwx1G78guji7pc3ywHHcnSCZrXdIbv1Vne5RAVLbEayq7mRp HhqRWDEUNdpNSblXU9y9ZI5DGb+opu/5Wr1IyOIWOLdglb50mg5xEQpLNI1HIwLJwWCA qY4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Pi0+njE8; 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 e26si9640582jam.19.2021.08.10.10.52.55; Tue, 10 Aug 2021 10:53:06 -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=Pi0+njE8; 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 S233561AbhHJRwc (ORCPT + 99 others); Tue, 10 Aug 2021 13:52:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:55516 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236623AbhHJRtd (ORCPT ); Tue, 10 Aug 2021 13:49:33 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 994E66124B; Tue, 10 Aug 2021 17:41:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1628617306; bh=oB0hprW6J5hYBJxtKmiWG+da6M0HtAcv804jgpvC75U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Pi0+njE8xnkPSAI5CFLYeKwZe94HhvdLMUP/d5LXog81M7AQWQFZHxwwxV/vX5Nhe qVC7ivslcdGnKC9tAw0Bk02LRNbZYtuONPOCJsnHDcif0/+CsPK6lJx1/CVzWzJdiy 9w1xrPR1n4AXVNy4PUXDz+lZkoiDoN3Q7CZuI6dE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Wei Shuyu , Guoqing Jiang , Song Liu Subject: [PATCH 5.10 109/135] md/raid10: properly indicate failure when ending a failed write request Date: Tue, 10 Aug 2021 19:30:43 +0200 Message-Id: <20210810172959.477804309@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210810172955.660225700@linuxfoundation.org> References: <20210810172955.660225700@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: Wei Shuyu commit 5ba03936c05584b6f6f79be5ebe7e5036c1dd252 upstream. Similar to [1], this patch fixes the same bug in raid10. Also cleanup the comments. [1] commit 2417b9869b81 ("md/raid1: properly indicate failure when ending a failed write request") Cc: stable@vger.kernel.org Fixes: 7cee6d4e6035 ("md/raid10: end bio when the device faulty") Signed-off-by: Wei Shuyu Acked-by: Guoqing Jiang Signed-off-by: Song Liu Signed-off-by: Greg Kroah-Hartman --- drivers/md/raid1.c | 2 -- drivers/md/raid10.c | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c @@ -472,8 +472,6 @@ static void raid1_end_write_request(stru /* * When the device is faulty, it is not necessary to * handle write error. - * For failfast, this is the only remaining device, - * We need to retry the write without FailFast. */ if (!test_bit(Faulty, &rdev->flags)) set_bit(R1BIO_WriteError, &r1_bio->state); --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c @@ -470,12 +470,12 @@ static void raid10_end_write_request(str /* * When the device is faulty, it is not necessary to * handle write error. - * For failfast, this is the only remaining device, - * We need to retry the write without FailFast. */ if (!test_bit(Faulty, &rdev->flags)) set_bit(R10BIO_WriteError, &r10_bio->state); else { + /* Fail the request */ + set_bit(R10BIO_Degraded, &r10_bio->state); r10_bio->devs[slot].bio = NULL; to_put = bio; dec_rdev = 1;