stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Brian Bunker <brian@purestorage.com>,
	Hannes Reinecke <hare@suse.de>,
	Krishna Kant <krishna.kant@purestorage.com>,
	Seamus Connor <sconnor@purestorage.com>,
	"Martin K . Petersen" <martin.petersen@oracle.com>,
	Sasha Levin <sashal@kernel.org>,
	jejb@linux.ibm.com, mwilck@suse.com, dan.carpenter@oracle.com,
	linux-scsi@vger.kernel.org
Subject: [PATCH AUTOSEL 5.17 01/23] scsi: scsi_dh_alua: Properly handle the ALUA transitioning state
Date: Wed, 18 May 2022 08:26:14 -0400	[thread overview]
Message-ID: <20220518122641.342120-1-sashal@kernel.org> (raw)

From: Brian Bunker <brian@purestorage.com>

[ 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 <hare@suse.de>
Acked-by: Krishna Kant <krishna.kant@purestorage.com>
Acked-by: Seamus Connor <sconnor@purestorage.com>
Signed-off-by: Brian Bunker <brian@purestorage.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 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


             reply	other threads:[~2022-05-18 12:26 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-18 12:26 Sasha Levin [this message]
2022-05-18 12:26 ` [PATCH AUTOSEL 5.17 02/23] scsi: qla2xxx: Fix missed DMA unmap for aborted commands Sasha Levin
2022-05-18 12:26 ` [PATCH AUTOSEL 5.17 03/23] mac80211: fix rx reordering with non explicit / psmp ack policy Sasha Levin
2022-05-18 12:26 ` [PATCH AUTOSEL 5.17 04/23] nl80211: validate S1G channel width Sasha Levin
2022-05-18 12:26 ` [PATCH AUTOSEL 5.17 05/23] cfg80211: retrieve S1G operating channel number Sasha Levin
2022-05-18 12:26 ` [PATCH AUTOSEL 5.17 06/23] selftests: add ping test with ping_group_range tuned Sasha Levin
2022-05-18 12:26 ` [PATCH AUTOSEL 5.17 07/23] Revert "fbdev: Make fb_release() return -ENODEV if fbdev was unregistered" Sasha Levin
2022-05-18 12:26 ` [PATCH AUTOSEL 5.17 08/23] fbdev: Prevent possible use-after-free in fb_release() Sasha Levin
2022-05-18 12:26 ` [PATCH AUTOSEL 5.17 09/23] platform/x86: thinkpad_acpi: Convert btusb DMI list to quirks Sasha Levin
2022-05-18 12:26 ` [PATCH AUTOSEL 5.17 10/23] platform/x86: thinkpad_acpi: Correct dual fan probe Sasha Levin
2022-05-18 12:26 ` [PATCH AUTOSEL 5.17 11/23] platform/x86/intel: Fix 'rmmod pmt_telemetry' panic Sasha Levin
2022-05-18 12:26 ` [PATCH AUTOSEL 5.17 12/23] platform/surface: gpe: Add support for Surface Pro 8 Sasha Levin
2022-05-18 12:26 ` [PATCH AUTOSEL 5.17 13/23] drm/amd/display: undo clearing of z10 related function pointers Sasha Levin
2022-05-18 12:36   ` VURDIGERENATARAJ, CHANDAN
2022-05-18 12:26 ` [PATCH AUTOSEL 5.17 14/23] net: fix wrong network header length Sasha Levin
2022-05-18 12:26 ` [PATCH AUTOSEL 5.17 15/23] nl80211: fix locking in nl80211_set_tx_bitrate_mask() Sasha Levin
2022-05-18 12:26 ` [PATCH AUTOSEL 5.17 16/23] ethernet: tulip: fix missing pci_disable_device() on error in tulip_init_one() Sasha Levin
2022-05-18 12:26 ` [PATCH AUTOSEL 5.17 17/23] net: stmmac: fix missing pci_disable_device() on error in stmmac_pci_probe() Sasha Levin
2022-05-18 12:26 ` [PATCH AUTOSEL 5.17 18/23] net: atlantic: fix "frag[0] not initialized" Sasha Levin
2022-05-18 12:26 ` [PATCH AUTOSEL 5.17 19/23] net: atlantic: reduce scope of is_rsc_complete Sasha Levin
2022-05-18 12:26 ` [PATCH AUTOSEL 5.17 20/23] net: atlantic: add check for MAX_SKB_FRAGS Sasha Levin
2022-05-18 12:26 ` [PATCH AUTOSEL 5.17 21/23] net: atlantic: verify hw_head_ lies within TX buffer ring Sasha Levin
2022-05-18 12:26 ` [PATCH AUTOSEL 5.17 22/23] arm64: Enable repeat tlbi workaround on KRYO4XX gold CPUs Sasha Levin
2022-05-18 12:26 ` [PATCH AUTOSEL 5.17 23/23] usb: gadget: fix race when gadget driver register via ioctl Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220518122641.342120-1-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=brian@purestorage.com \
    --cc=dan.carpenter@oracle.com \
    --cc=hare@suse.de \
    --cc=jejb@linux.ibm.com \
    --cc=krishna.kant@purestorage.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=mwilck@suse.com \
    --cc=sconnor@purestorage.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).