Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp431610iob; Wed, 18 May 2022 05:29:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwzXzmMgtY/vmg9A3XGu5tvNfPAiuSAfJNvZROvVI7y1Or5lDd6z7BCiK18NiKeaAN6BwPn X-Received: by 2002:a17:90b:50b:b0:1dc:a0b1:c783 with SMTP id r11-20020a17090b050b00b001dca0b1c783mr42029561pjz.49.1652876952016; Wed, 18 May 2022 05:29:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652876952; cv=none; d=google.com; s=arc-20160816; b=Fsxw2N4xwneqAdWMT06+6XyVc7hCex9TegUYn+ZNbMofMqUexVXH9eFP7SuD5iEkKt FREk2upH81YuDSotPipuwk0HQNPk0/coI4KqLMFM6gWUYzYbxn4/WS8eLxnryQnyxfN7 N73l3bqHnrdwgftmXVujky7RmjbooSXUTZiLoMjyUueOAFQ6FwJQ/mHQNvJxVq99fhMr 0isdh2Vx7E85alSRUlHcMYLJMoYwwWy8P5K4HX3Wxa5Yvn/ObhAKrPnd7TPtbtPt1LIp QJa2zZ52B27697iy0PqCbLobdzmRW/9YxIVXU501JLyEfGGmbVr0tXSCJS8gVPltxAv8 xZHw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=H1nS6pXb81UJgVK0Lw37/r8Iqnf9OPQKgbRby1Rq1pc=; b=sDdIl9vAdBGtYRpKZSKNX2HjNMJAJrRqnseSRfOg5Y8jtNjcGBozROTkoV2BVtZ8WH ja7F8Nq43QsjgfmvocDdAriQe7INWwwn/+a83SaXwcPJngE+W2+2p6t/NU8eMLGdWr2w B7WY42lUjHMgwWd2oF+Y6X+2qkfhq/d4CePi5v43ZHN7/JvQwWbcLqzJZGlL99fT19Xe Xoc68ye633CFKUrIHFtII28TK5kZv18Razaz/Zne7FGj+z8d3OqPaqmG1moITmsH6AXk aTg3GUwGra+2jyrWb2L4Uapr1OupJWi9Az8s2URvUQzQoHOeixa34sVF27XpGAKLSEF1 rBrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=OMhCNOuF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id l11-20020a056a00140b00b0050e0530cfe4si3181847pfu.279.2022.05.18.05.29.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 May 2022 05:29:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=OMhCNOuF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 62BEA6F4A1; Wed, 18 May 2022 05:27:01 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236405AbiERM0u (ORCPT + 99 others); Wed, 18 May 2022 08:26:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45624 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236379AbiERM0q (ORCPT ); Wed, 18 May 2022 08:26:46 -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 B1E7F69B5B; Wed, 18 May 2022 05:26:45 -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 51F3B61627; Wed, 18 May 2022 12:26:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4EB36C34100; Wed, 18 May 2022 12:26:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1652876804; bh=Q6WGn+T2IYOJX+pYvJtK4Xq4x5ALfQD1/9ZqxdvFrkU=; h=From:To:Cc:Subject:Date:From; b=OMhCNOuFtmdf295e2cSWuHc1odNkmt9gZejZIdAi+F1LOeQMvNVgd0QcDC4ES6KMy YlEhxamD3b2ruDxZFx5cpv6wjlZ/JSV2QwLhQ8s7p2kDZQO8phxj3D93rI6+Bw6FcB NnFiwQjcu7GYtbqJq4lYuNSuDxP4sOOkL3edBn7AnvBUuB5/d/vano7FsIeyYGg9Wv KskFvIIKiIinf9j3oj3JJHL4F7LbJw8tfzc+PXQ6Lj2UYjXOCvWevfHCvIHIBpd8Jf 1IbG21fa1o9iBp+DA2XgAmI8HveFaVybsz2QJ8fVEPUQK2AepGCal8Hat5kTozB17H 4EfbLZBl+7F1w== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Brian Bunker , Hannes Reinecke , Krishna Kant , Seamus Connor , "Martin K . Petersen" , Sasha Levin , 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 Message-Id: <20220518122641.342120-1-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore 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,DKIM_VALID_EF,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