From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D14A04A33; Mon, 24 Feb 2025 14:38:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740407921; cv=none; b=YvGIJFPqZRz10RNvgPMiKgLUmcL4W2mDO71MrGgUy3LdAkPa854E1P9RuxHSFHCO2xuKQqA/NukEtmPeCTbBXXy/SrwEGYXAQLbOfuAE69ummkHa/PnA3MNXI2sauT8mU+u5ayz6H9delO0VvU4beWsXwBLu7mliRb5EkxKBvGs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740407921; c=relaxed/simple; bh=m9Ot6gPKOMKY//nu5cyto7sGXKOkMrr54vR5RPrG7LM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=eYk3UhFGWlQcoHb+ua5xpXgmaPBIK91Xtbno8ow0VjNKsbcRrVSHKGRqDbazRtvzvtssRjUVSFRTIAopSFD1jEg8dW0pcIXrlTEeA46zZ3XRwW/QAqDy1C1lOcX9celt3UBoZT/XK3eye2u1ISwZVk7A+CjoCdCAkdu3a7/dBGk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=eLEHfpp3; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="eLEHfpp3" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D0A1DC4CED6; Mon, 24 Feb 2025 14:38:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1740407920; bh=m9Ot6gPKOMKY//nu5cyto7sGXKOkMrr54vR5RPrG7LM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eLEHfpp3ya9pJpRfJqXWqr0qCFURW8MSRMF8KYl0b9EtjHYBgd1MFm7MBao1KfMee 1kjegfeJhQCOfxPkez0BshH5A7HX695usILGuZDTAkq68oh1OOMGczy42dj6i12iM/ eW+7mqorkTYIsAD5ZVd92hULFpZgPQIpSFgVXy84= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Igor Pylypiv , "Martin K. Petersen" , Sasha Levin Subject: [PATCH 6.6 047/140] scsi: core: Do not retry I/Os during depopulation Date: Mon, 24 Feb 2025 15:34:06 +0100 Message-ID: <20250224142604.860326394@linuxfoundation.org> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250224142602.998423469@linuxfoundation.org> References: <20250224142602.998423469@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Igor Pylypiv [ Upstream commit 9ff7c383b8ac0c482a1da7989f703406d78445c6 ] Fail I/Os instead of retry to prevent user space processes from being blocked on the I/O completion for several minutes. Retrying I/Os during "depopulation in progress" or "depopulation restore in progress" results in a continuous retry loop until the depopulation completes or until the I/O retry loop is aborted due to a timeout by the scsi_cmd_runtime_exceeced(). Depopulation is slow and can take 24+ hours to complete on 20+ TB HDDs. Most I/Os in the depopulation retry loop end up taking several minutes before returning the failure to user space. Cc: stable@vger.kernel.org # 4.18.x: 2bbeb8d scsi: core: Handle depopulation and restoration in progress Cc: stable@vger.kernel.org # 4.18.x Fixes: e37c7d9a0341 ("scsi: core: sanitize++ in progress") Signed-off-by: Igor Pylypiv Link: https://lore.kernel.org/r/20250131184408.859579-1-ipylypiv@google.com Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/scsi_lib.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 2f54e1a853099..f026377f1cf1c 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -774,13 +774,18 @@ static void scsi_io_completion_action(struct scsi_cmnd *cmd, int result) case 0x1a: /* start stop unit in progress */ case 0x1b: /* sanitize in progress */ case 0x1d: /* configuration in progress */ - case 0x24: /* depopulation in progress */ - case 0x25: /* depopulation restore in progress */ action = ACTION_DELAYED_RETRY; break; case 0x0a: /* ALUA state transition */ action = ACTION_DELAYED_REPREP; break; + /* + * Depopulation might take many hours, + * thus it is not worthwhile to retry. + */ + case 0x24: /* depopulation in progress */ + case 0x25: /* depopulation restore in progress */ + fallthrough; default: action = ACTION_FAIL; break; -- 2.39.5