Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp483157pxu; Wed, 14 Oct 2020 06:25:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwk+y0gQ0RFet9ZLafe6jySuVGoliiXnsTVn3garSxl2E/IpMHxbWuuGYtOL/mXajV0qlig X-Received: by 2002:a05:6402:1c8f:: with SMTP id cy15mr5208653edb.335.1602681959224; Wed, 14 Oct 2020 06:25:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602681959; cv=none; d=google.com; s=arc-20160816; b=soUHbmT67DuDoAsV7w9kHcSlgNXObMsMYp4soMUJ7BojKO7rXOyPditgsFAo/mCnJT A6opgzjAqjVOtej0it5qikkBLzoTM/WzYJojo2x5YsGQoZTF8RAHPEabPPATyR9pELaj tAE0S4r+jAPHst1zCv4Gpd2XmM46krZRjDA5x6iUkDJzOEknwElkVOGvlmDYmMySgVc5 sqXRoa78jLhUPg6Yo8OTAXvl6lUj6GRlSR9uSb+IwqFYxLI66JStSp1ynMWiByirgEHo 3MufdWFbZ3gT3QSXUFjHFuYY3n98FcGx6Zj0SpHEqhuY9wFtV9DLugIHXWfFesQtMOX4 k6TQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=ed8Hk1lH5GyAmnFBvFMOm+wGCikOEKuXUKoQeBi4dMI=; b=O603BQvV+q7adUvHpKJY0/yFzXJGxqbKrAXeWiZLj6F9wmOTckC7/I8KqKXY4A/rK7 fhy5kGFa0drWpj4JBZiQuFurdScHDAp6T9mbRvTynwRERoigxTkd1TW8i69QvucEA/Tl iyx3Dcgkim4sga9qXbpurg8HG5NE8OE4bu/dd/K8tdug0E8bUVaWzUQjAIgzfYaHObgH Cm8TEeO662TqyJ1c/8sxhPQFK4mfm3yQuOOGWp+3DQj/7VEa09M3U29dYmD9mmyxzf+H nwTD7mWTkaheFO2w3LaKRgMfZ9tknooacNSZ/7eJMpYeeeIDvVKdAcO/XvvoQDW3tELu Ybpg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a17si2094015ejy.684.2020.10.14.06.25.37; Wed, 14 Oct 2020 06:25:59 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727499AbgJNHa4 (ORCPT + 99 others); Wed, 14 Oct 2020 03:30:56 -0400 Received: from mx2.suse.de ([195.135.220.15]:49336 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725934AbgJNHaz (ORCPT ); Wed, 14 Oct 2020 03:30:55 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id EB916AD6B; Wed, 14 Oct 2020 07:30:53 +0000 (UTC) From: Daniel Wagner To: Nilesh Javali , Arun Easi Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Finn Thain , Daniel Wagner Subject: [PATCH v4] qla2xxx: Return EBUSY on fcport deletion Date: Wed, 14 Oct 2020 09:30:48 +0200 Message-Id: <20201014073048.36219-1-dwagner@suse.de> X-Mailer: git-send-email 2.16.4 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When the fcport is about to be deleted we should return EBUSY instead of ENODEV. Only for EBUSY the request will be requeued in a multipath setup. Also when the firmware has not yet started return EBUSY to avoid dropping the request. Signed-off-by: Daniel Wagner Reviewed-by: Arun Easi --- v4: updated commit message as suggested by Finn v3: simplify and changed test logic as suggested by Arun v2: rebased on mkp/staging drivers/scsi/qla2xxx/qla_nvme.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_nvme.c b/drivers/scsi/qla2xxx/qla_nvme.c index 2cd9bd288910..1fa457a5736e 100644 --- a/drivers/scsi/qla2xxx/qla_nvme.c +++ b/drivers/scsi/qla2xxx/qla_nvme.c @@ -555,10 +555,12 @@ static int qla_nvme_post_cmd(struct nvme_fc_local_port *lport, fcport = qla_rport->fcport; - if (!qpair || !fcport || (qpair && !qpair->fw_started) || - (fcport && fcport->deleted)) + if (!qpair || !fcport) return -ENODEV; + if (!qpair->fw_started || fcport->deleted) + return -EBUSY; + vha = fcport->vha; if (!(fcport->nvme_flag & NVME_FLAG_REGISTERED)) -- 2.16.4