Received: by 2002:ac2:464d:0:0:0:0:0 with SMTP id s13csp3667798lfo; Mon, 23 May 2022 10:50:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzCFr8M/I1HhhsM0SoktVXQV3THjS430dYpN2vUg9b+LnVUt17fAd7rpq8kgHrfikNi9bhl X-Received: by 2002:a63:5f43:0:b0:3f6:3a45:d4ca with SMTP id t64-20020a635f43000000b003f63a45d4camr20268458pgb.344.1653328255995; Mon, 23 May 2022 10:50:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653328255; cv=none; d=google.com; s=arc-20160816; b=NFZ/QyzMr4MFCMQyLzm0DX2WOTp+haZZmtGUdv1Qe/ulNbO+42BYqORNTt3rPTFfbW lbFplPrhWTHgUbWyHBx5J7dyxwmvRpCyV+aXDuhxJHCPPk3buvG3ufyccodk2TplF4Ty SCk0U+mwX5+NNIBIpM62DlBvU0l27fmQNq3xoG5bieZdPXoECp/nIE9tfCOOX71iye5X bA2QbOh243OTLiA11Pn1gHiRTM2cRLgU0r9qJgS0kcOb7R3A9nJRXf3Oly+CDgUSvdlL Fg0HMSwaVmvSBC52ameKFBlGrudlsxXt6hQh/bb8nHvdRK6q66wSZWGqNfl6RoA69MuB wbZQ== 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=H1nS6pXb81UJgVK0Lw37/r8Iqnf9OPQKgbRby1Rq1pc=; b=TOZ8LEhf56JjTWPUsz8yFoYLPMsoMkSAkBAr8Qh5oJzy2vw6O0bFHitSSKr2PNpno4 xv77fzLeaf7s0ha3vCwlx8oRBnsbKmmDiB9c8L1PpYmnnnYb0QDXU3GDXUQm6xjtfkgh fDjznBYec6MwzGlXW0URg2/JPXmjX37M4WLCcq2cQAOCRG4WLwyp7Go//AIvGILqg77e PhwS5UrxuJmBwEzFg/kKIi1QjYhNHyjHf6mUiy/bzbrwQKV6TKcF/8mBCv2s/HKIuIJG GGb8HBU9ddacYfY43U8tx+8x+CuYBTIOB4LxzqnG8WVxJL/6h/jDCF+OTgOssZ3mz4Cg ZW+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=uKYcyBmK; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id j7-20020a17090276c700b0016152774876si10207648plt.144.2022.05.23.10.50.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 10:50:55 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=uKYcyBmK; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 932E1106A61; Mon, 23 May 2022 10:50:40 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243208AbiEWRqr (ORCPT + 99 others); Mon, 23 May 2022 13:46:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38258 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242666AbiEWR1z (ORCPT ); Mon, 23 May 2022 13:27:55 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BCC268720C; Mon, 23 May 2022 10:23:58 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E35FA60916; Mon, 23 May 2022 17:23:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CA4BCC385AA; Mon, 23 May 2022 17:23:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1653326609; bh=Q6WGn+T2IYOJX+pYvJtK4Xq4x5ALfQD1/9ZqxdvFrkU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uKYcyBmK29pg/AE0n8ybqE7U3LSQW0bJztv6wWkNWLxgXya5M2teKvSYVasggkOYW 1o2vlkeXV1NzQ0jf6tZgHbpaOtoDYBR5eB0RKc6e/jcBxFN0emGJQg8F8L/g8cOQKi CiZZypge5odrXy5mbQEHjToRod0qTlV1syBxBr4A= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hannes Reinecke , Krishna Kant , Seamus Connor , Brian Bunker , "Martin K. Petersen" , Sasha Levin Subject: [PATCH 5.15 112/132] scsi: scsi_dh_alua: Properly handle the ALUA transitioning state Date: Mon, 23 May 2022 19:05:21 +0200 Message-Id: <20220523165842.085007434@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220523165823.492309987@linuxfoundation.org> References: <20220523165823.492309987@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Brian Bunker [ Upstream commit 6056a92ceb2a7705d61df7ec5370548e96aee258 ] The handling of the ALUA transitioning state is currently broken. When a target goes into this state, it is expected that the target is allowed to stay in this state for the implicit transition timeout without a path failure. The handler has this logic, but it gets skipped currently. When the target transitions, there is in-flight I/O from the initiator. The first of these responses from the target will be a unit attention letting the initiator know that the ALUA state has changed. The remaining in-flight I/Os, before the initiator finds out that the portal state has changed, will return not ready, ALUA state is transitioning. The portal state will change to SCSI_ACCESS_STATE_TRANSITIONING. This will lead to all new I/O immediately failing the path unexpectedly. The path failure happens in less than a second instead of the expected successes until the transition timer is exceeded. Allow I/Os to continue while the path is in the ALUA transitioning state. The handler already takes care of a target that stays in the transitioning state for too long by changing the state to ALUA state standby once the transition timeout is exceeded at which point the path will fail. Link: https://lore.kernel.org/r/CAHZQxy+4sTPz9+pY3=7VJH+CLUJsDct81KtnR2be8ycN5mhqTg@mail.gmail.com Reviewed-by: Hannes Reinecke Acked-by: Krishna Kant Acked-by: Seamus Connor Signed-off-by: Brian Bunker Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/device_handler/scsi_dh_alua.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/scsi/device_handler/scsi_dh_alua.c b/drivers/scsi/device_handler/scsi_dh_alua.c index 37d06f993b76..1d9be771f3ee 100644 --- a/drivers/scsi/device_handler/scsi_dh_alua.c +++ b/drivers/scsi/device_handler/scsi_dh_alua.c @@ -1172,9 +1172,8 @@ static blk_status_t alua_prep_fn(struct scsi_device *sdev, struct request *req) case SCSI_ACCESS_STATE_OPTIMAL: case SCSI_ACCESS_STATE_ACTIVE: case SCSI_ACCESS_STATE_LBA: - return BLK_STS_OK; case SCSI_ACCESS_STATE_TRANSITIONING: - return BLK_STS_AGAIN; + return BLK_STS_OK; default: req->rq_flags |= RQF_QUIET; return BLK_STS_IOERR; -- 2.35.1