Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp3761015pxt; Tue, 10 Aug 2021 10:41:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwL8+BVc+3c+bhmoRY7w3YvKDtQaJCpIjjlqNIrxAq3L31TChtLhHz3DX/1p5U1+run5H6a X-Received: by 2002:a17:906:404:: with SMTP id d4mr28912784eja.449.1628617311959; Tue, 10 Aug 2021 10:41:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628617311; cv=none; d=google.com; s=arc-20160816; b=JcMKQ/m6AKvW1v0d4tWP2mM2xVy8kz4FZVkiwRh930fH34osdKgDKtISl7rIKgQ0qS 7bsGCSQJRKl9kuOTkW9Hzsf78jVnhb9AGOQkCpsCJPW8MHU1fp+foP0y8uWpDzyYK17A 6xS51+8dhZYnBKBmbAmznqLeyN7MWm9Rxn2czAmd83B8YUfikE8WlKiFgz1y2anjHEo/ 82kL8W7dSiow49Dme7XuCosdW8dWgSOXKevW1y+ESYqvzqiYHOKhkA3SI1NsTdBvtaR3 TgupkITxTe11vDYsboao5GG1z4CKJHkcbzrpc4rDzfB982yjLF4itVO1RnBlJWDM8a3I IjXQ== 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=HjLiwoo3OBYVCUXYqR5YrLp3KTxeZrg72VZdzB9BfBE=; b=pJuO0zaZaxYzX2uFsvhUPL+zn0A5O88sqCUy/qz2BKtRGcpeKjUnMSomLT693DTXDn xzwP/4cDTZeiMaALHtyQWBQG9MV9YFlEC3gVCDs0ZCX5SDEWt1HbnPvoJOq1VeppAjEA lqLlZ6E0esv9EpJdxkpKAwdOkY/b8CZ5nMNZd+sd3tKWZYyb649UT1I7HCnwsBPZ//zq mQXp4NXuwXytgpxvZ/WC+bwPumbsbDFeADwEUa1kgxPz5okNKoi/ogsdBMrblAd1wqQH sic66dTkFdH8NzD46cb36k6l3vKPAMRkKD+IkAf3TcUPPmRTt+VCpZnMmxu0OYQtoZLZ 9vQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ugevDNuC; 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 h4si5896720edt.426.2021.08.10.10.41.25; Tue, 10 Aug 2021 10:41:51 -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=ugevDNuC; 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 S231557AbhHJRkI (ORCPT + 99 others); Tue, 10 Aug 2021 13:40:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:37254 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234257AbhHJRhK (ORCPT ); Tue, 10 Aug 2021 13:37:10 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6758F60295; Tue, 10 Aug 2021 17:35:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1628616959; bh=K42bGWNxHrgDLBVJIrAu0dnTY4Fm2tfgkVSEZ0fd0xk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ugevDNuCqy/Va3ZgtmDLc1qdsNbU32nkrA3898OCX4xIReRPz631fH6OJb9UT5sXu MjdQ/3lxDYbT9IUQuVC+aeLdR2qmJgDDjyxM0ryqdYpR3MUxn1s0JxZI2+3bXqbOnO Uho+l9fbyvSrcc1Dm+/tPbmcqoyo+WP3i25N7rEk= 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.4 69/85] md/raid10: properly indicate failure when ending a failed write request Date: Tue, 10 Aug 2021 19:30:42 +0200 Message-Id: <20210810172950.576307848@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210810172948.192298392@linuxfoundation.org> References: <20210810172948.192298392@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 @@ -452,8 +452,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;