diff mbox series

[v2,08/13] qla2xxx: Fix I/O errors during LIP reset tests

Message ID 20200902072548.11491-9-njavali@marvell.com (mailing list archive)
State Superseded
Headers show
Series qla2xxx misc features and bug fixes | expand

Commit Message

Nilesh Javali Sept. 2, 2020, 7:25 a.m. UTC
From: Arun Easi <aeasi@marvell.com>

In .fcp_io(), returning ENODEV as soon as remote port delete has started
can cause I/O errors. Fix this by returning EBUSY until the remote port
delete finishes.

Signed-off-by: Arun Easi <aeasi@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
---
 drivers/scsi/qla2xxx/qla_nvme.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

Comments

Himanshu Madhani Sept. 2, 2020, 3:54 p.m. UTC | #1
> On Sep 2, 2020, at 2:25 AM, Nilesh Javali <njavali@marvell.com> wrote:
> 
> From: Arun Easi <aeasi@marvell.com>
> 
> In .fcp_io(), returning ENODEV as soon as remote port delete has started
> can cause I/O errors. Fix this by returning EBUSY until the remote port
> delete finishes.
> 
> Signed-off-by: Arun Easi <aeasi@marvell.com>
> Signed-off-by: Nilesh Javali <njavali@marvell.com>
> ---
> drivers/scsi/qla2xxx/qla_nvme.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
> 
> diff --git a/drivers/scsi/qla2xxx/qla_nvme.c b/drivers/scsi/qla2xxx/qla_nvme.c
> index b0c13144c21a..675f2b1180e8 100644
> --- a/drivers/scsi/qla2xxx/qla_nvme.c
> +++ b/drivers/scsi/qla2xxx/qla_nvme.c
> @@ -548,6 +548,16 @@ static int qla_nvme_post_cmd(struct nvme_fc_local_port *lport,
> 		return rval;
> 
> 	vha = fcport->vha;
> +
> +	if (!(fcport->nvme_flag & NVME_FLAG_REGISTERED))
> +		return rval;
> +
> +	if (test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags))
> +		return -EBUSY;
> +
> +	if ((qpair && !qpair->fw_started) || fcport->deleted)
> +		return -EBUSY;
> +

Small nit

Why not combine above 2 if statements as 

	if (test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags) ||
	    (qpair && !qpair->fw_started) || fcport->deleted)
		return -EBUSY;

> 	/*
> 	 * If we know the dev is going away while the transport is still sending
> 	 * IO's return busy back to stall the IO Q.  This happens when the
> -- 
> 2.19.0.rc0
> 

--
Himanshu Madhani	 Oracle Linux Engineering
diff mbox series

Patch

diff --git a/drivers/scsi/qla2xxx/qla_nvme.c b/drivers/scsi/qla2xxx/qla_nvme.c
index b0c13144c21a..675f2b1180e8 100644
--- a/drivers/scsi/qla2xxx/qla_nvme.c
+++ b/drivers/scsi/qla2xxx/qla_nvme.c
@@ -548,6 +548,16 @@  static int qla_nvme_post_cmd(struct nvme_fc_local_port *lport,
 		return rval;
 
 	vha = fcport->vha;
+
+	if (!(fcport->nvme_flag & NVME_FLAG_REGISTERED))
+		return rval;
+
+	if (test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags))
+		return -EBUSY;
+
+	if ((qpair && !qpair->fw_started) || fcport->deleted)
+		return -EBUSY;
+
 	/*
 	 * If we know the dev is going away while the transport is still sending
 	 * IO's return busy back to stall the IO Q.  This happens when the