diff mbox series

qla2xxx: Fix I/Os being passed down when FC device is being deleted.

Message ID 20200313085001.3781-1-njavali@marvell.com (mailing list archive)
State Mainlined
Commit 78c3e5e6cde8193467427ed9e5f90a0d585625a1
Headers show
Series qla2xxx: Fix I/Os being passed down when FC device is being deleted. | expand

Commit Message

Nilesh Javali March 13, 2020, 8:50 a.m. UTC
From: Arun Easi <aeasi@marvell.com>

I/Os could be passed down while the device FC SCSI device is being deleted.
This would result in unnecessary delay of I/O and driver messages (when
extended logging is set).

Signed-off-by: Arun Easi <aeasi@marvell.com>
---
 drivers/scsi/qla2xxx/qla_os.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Laurence Oberman March 13, 2020, 12:03 p.m. UTC | #1
On Fri, 2020-03-13 at 01:50 -0700, Nilesh Javali wrote:
> From: Arun Easi <aeasi@marvell.com>
> 
> I/Os could be passed down while the device FC SCSI device is being
> deleted.
> This would result in unnecessary delay of I/O and driver messages
> (when
> extended logging is set).
> 
> Signed-off-by: Arun Easi <aeasi@marvell.com>
> ---
>  drivers/scsi/qla2xxx/qla_os.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/scsi/qla2xxx/qla_os.c
> b/drivers/scsi/qla2xxx/qla_os.c
> index b520a98..7a94e11 100644
> --- a/drivers/scsi/qla2xxx/qla_os.c
> +++ b/drivers/scsi/qla2xxx/qla_os.c
> @@ -864,7 +864,7 @@ void qla2xxx_qpair_sp_compl(srb_t *sp, int res)
>  		goto qc24_fail_command;
>  	}
>  
> -	if (atomic_read(&fcport->state) != FCS_ONLINE) {
> +	if (atomic_read(&fcport->state) != FCS_ONLINE || fcport-
> >deleted) {
>  		if (atomic_read(&fcport->state) == FCS_DEVICE_DEAD ||
>  			atomic_read(&base_vha->loop_state) ==
> LOOP_DEAD) {
>  			ql_dbg(ql_dbg_io, vha, 0x3005,
> @@ -946,7 +946,7 @@ void qla2xxx_qpair_sp_compl(srb_t *sp, int res)
>  		goto qc24_fail_command;
>  	}
>  
> -	if (atomic_read(&fcport->state) != FCS_ONLINE) {
> +	if (atomic_read(&fcport->state) != FCS_ONLINE || fcport-
> >deleted) {
>  		if (atomic_read(&fcport->state) == FCS_DEVICE_DEAD ||
>  			atomic_read(&base_vha->loop_state) ==
> LOOP_DEAD) {
>  			ql_dbg(ql_dbg_io, vha, 0x3077,

Tested-by:   Laurence Oberman <loberman@redhat.com>
Reviewed-by: Laurence Oberman <loberman@redhat.com>

Built and tested in Red Hat CEE lab with fault injection.
Ewan Milne March 13, 2020, 2:09 p.m. UTC | #2
On Fri, 2020-03-13 at 01:50 -0700, Nilesh Javali wrote:
> From: Arun Easi <aeasi@marvell.com>
> 
> I/Os could be passed down while the device FC SCSI device is being deleted.
> This would result in unnecessary delay of I/O and driver messages (when
> extended logging is set).
> 
> Signed-off-by: Arun Easi <aeasi@marvell.com>
> ---
>  drivers/scsi/qla2xxx/qla_os.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
> index b520a98..7a94e11 100644
> --- a/drivers/scsi/qla2xxx/qla_os.c
> +++ b/drivers/scsi/qla2xxx/qla_os.c
> @@ -864,7 +864,7 @@ void qla2xxx_qpair_sp_compl(srb_t *sp, int res)
>  		goto qc24_fail_command;
>  	}
>  
> -	if (atomic_read(&fcport->state) != FCS_ONLINE) {
> +	if (atomic_read(&fcport->state) != FCS_ONLINE || fcport->deleted) {
>  		if (atomic_read(&fcport->state) == FCS_DEVICE_DEAD ||
>  			atomic_read(&base_vha->loop_state) == LOOP_DEAD) {
>  			ql_dbg(ql_dbg_io, vha, 0x3005,
> @@ -946,7 +946,7 @@ void qla2xxx_qpair_sp_compl(srb_t *sp, int res)
>  		goto qc24_fail_command;
>  	}
>  
> -	if (atomic_read(&fcport->state) != FCS_ONLINE) {
> +	if (atomic_read(&fcport->state) != FCS_ONLINE || fcport->deleted) {
>  		if (atomic_read(&fcport->state) == FCS_DEVICE_DEAD ||
>  			atomic_read(&base_vha->loop_state) == LOOP_DEAD) {
>  			ql_dbg(ql_dbg_io, vha, 0x3077,

This fixes an easily reproducible problem and should
be considered for -stable.  It generally happens with
extended driver logging enabled though.

Fixes: a8a12eb1920c ("scsi: qla2xxx: Remove defer flag to indicate immeadiate port loss")
Reviewed-by: Ewan D. Milne <emilne@redhat.com>
Bart Van Assche March 13, 2020, 2:44 p.m. UTC | #3
On 2020-03-13 07:09, Ewan D. Milne wrote:
> On Fri, 2020-03-13 at 01:50 -0700, Nilesh Javali wrote:
>> From: Arun Easi <aeasi@marvell.com>
>>
>> I/Os could be passed down while the device FC SCSI device is being deleted.
>> This would result in unnecessary delay of I/O and driver messages (when
>> extended logging is set).
>>
>> Signed-off-by: Arun Easi <aeasi@marvell.com>
>> ---
>>  drivers/scsi/qla2xxx/qla_os.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
>> index b520a98..7a94e11 100644
>> --- a/drivers/scsi/qla2xxx/qla_os.c
>> +++ b/drivers/scsi/qla2xxx/qla_os.c
>> @@ -864,7 +864,7 @@ void qla2xxx_qpair_sp_compl(srb_t *sp, int res)
>>  		goto qc24_fail_command;
>>  	}
>>  
>> -	if (atomic_read(&fcport->state) != FCS_ONLINE) {
>> +	if (atomic_read(&fcport->state) != FCS_ONLINE || fcport->deleted) {
>>  		if (atomic_read(&fcport->state) == FCS_DEVICE_DEAD ||
>>  			atomic_read(&base_vha->loop_state) == LOOP_DEAD) {
>>  			ql_dbg(ql_dbg_io, vha, 0x3005,
>> @@ -946,7 +946,7 @@ void qla2xxx_qpair_sp_compl(srb_t *sp, int res)
>>  		goto qc24_fail_command;
>>  	}
>>  
>> -	if (atomic_read(&fcport->state) != FCS_ONLINE) {
>> +	if (atomic_read(&fcport->state) != FCS_ONLINE || fcport->deleted) {
>>  		if (atomic_read(&fcport->state) == FCS_DEVICE_DEAD ||
>>  			atomic_read(&base_vha->loop_state) == LOOP_DEAD) {
>>  			ql_dbg(ql_dbg_io, vha, 0x3077,
> 
> This fixes an easily reproducible problem and should
> be considered for -stable.  It generally happens with
> extended driver logging enabled though.
> 
> Fixes: a8a12eb1920c ("scsi: qla2xxx: Remove defer flag to indicate immeadiate port loss")
> Reviewed-by: Ewan D. Milne <emilne@redhat.com>

Hi Ewan,

That commit ID does not exist. Did you perhaps want to refer to
3c75ad1d87c7 ("scsi: qla2xxx: Remove defer flag to indicate immeadiate
port loss") # v5.6-rc1?

Thanks,

Bart.
Ewan Milne March 13, 2020, 6:45 p.m. UTC | #4
On Fri, 2020-03-13 at 07:44 -0700, Bart Van Assche wrote:
> On 2020-03-13 07:09, Ewan D. Milne wrote:
> > On Fri, 2020-03-13 at 01:50 -0700, Nilesh Javali wrote:
> > > From: Arun Easi <aeasi@marvell.com>
> > > 
> > > I/Os could be passed down while the device FC SCSI device is being deleted.
> > > This would result in unnecessary delay of I/O and driver messages (when
> > > extended logging is set).
> > > 
> > > Signed-off-by: Arun Easi <aeasi@marvell.com>
> > > ---
> > >  drivers/scsi/qla2xxx/qla_os.c | 4 ++--
> > >  1 file changed, 2 insertions(+), 2 deletions(-)
> > > 
> > > diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
> > > index b520a98..7a94e11 100644
> > > --- a/drivers/scsi/qla2xxx/qla_os.c
> > > +++ b/drivers/scsi/qla2xxx/qla_os.c
> > > @@ -864,7 +864,7 @@ void qla2xxx_qpair_sp_compl(srb_t *sp, int res)
> > >  		goto qc24_fail_command;
> > >  	}
> > >  
> > > -	if (atomic_read(&fcport->state) != FCS_ONLINE) {
> > > +	if (atomic_read(&fcport->state) != FCS_ONLINE || fcport->deleted) {
> > >  		if (atomic_read(&fcport->state) == FCS_DEVICE_DEAD ||
> > >  			atomic_read(&base_vha->loop_state) == LOOP_DEAD) {
> > >  			ql_dbg(ql_dbg_io, vha, 0x3005,
> > > @@ -946,7 +946,7 @@ void qla2xxx_qpair_sp_compl(srb_t *sp, int res)
> > >  		goto qc24_fail_command;
> > >  	}
> > >  
> > > -	if (atomic_read(&fcport->state) != FCS_ONLINE) {
> > > +	if (atomic_read(&fcport->state) != FCS_ONLINE || fcport->deleted) {
> > >  		if (atomic_read(&fcport->state) == FCS_DEVICE_DEAD ||
> > >  			atomic_read(&base_vha->loop_state) == LOOP_DEAD) {
> > >  			ql_dbg(ql_dbg_io, vha, 0x3077,
> > 
> > This fixes an easily reproducible problem and should
> > be considered for -stable.  It generally happens with
> > extended driver logging enabled though.
> > 
> > Fixes: a8a12eb1920c ("scsi: qla2xxx: Remove defer flag to indicate immeadiate port loss")
> > Reviewed-by: Ewan D. Milne <emilne@redhat.com>
> 
> Hi Ewan,
> 
> That commit ID does not exist. Did you perhaps want to refer to
> 3c75ad1d87c7 ("scsi: qla2xxx: Remove defer flag to indicate immeadiate
> port loss") # v5.6-rc1?
> 
> Thanks,
> 
> Bart.

Yes, that's the one.  Sorry, I can't figure out how I managed
to copy that ID.  It's not a commit in any tree I use.  Thanks.

-Ewan
Roman Bolshakov March 16, 2020, 6:38 p.m. UTC | #5
On Fri, Mar 13, 2020 at 01:50:01AM -0700, Nilesh Javali wrote:
> From: Arun Easi <aeasi@marvell.com>
> 
> I/Os could be passed down while the device FC SCSI device is being deleted.
> This would result in unnecessary delay of I/O and driver messages (when
> extended logging is set).
> 
> Signed-off-by: Arun Easi <aeasi@marvell.com>
> ---
>  drivers/scsi/qla2xxx/qla_os.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 

Hi Nilesh, Arun,

Reviewed-by: Roman Bolshakov <r.bolshakov@yadro.com>

Thanks,
Roman
Himanshu Madhani March 17, 2020, 2:16 p.m. UTC | #6
On 3/16/2020 1:38 PM, Roman Bolshakov wrote:
> On Fri, Mar 13, 2020 at 01:50:01AM -0700, Nilesh Javali wrote:
>> From: Arun Easi <aeasi@marvell.com>
>>
>> I/Os could be passed down while the device FC SCSI device is being deleted.
>> This would result in unnecessary delay of I/O and driver messages (when
>> extended logging is set).
>>
>> Signed-off-by: Arun Easi <aeasi@marvell.com>
>> ---
>>   drivers/scsi/qla2xxx/qla_os.c | 4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>
> 
> Hi Nilesh, Arun,
> 
> Reviewed-by: Roman Bolshakov <r.bolshakov@yadro.com>
> 
> Thanks,
> Roman
> 

Thanks Arun. FWIW, I remember this change :)

Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Martin K. Petersen March 17, 2020, 4:37 p.m. UTC | #7
Nilesh,

> I/Os could be passed down while the device FC SCSI device is being
> deleted.  This would result in unnecessary delay of I/O and driver
> messages (when extended logging is set).

Applied to 5.6/scsi-fixes. I corrected the Fixes: commit hash and added
your SoB which was missing.
Arun Easi March 23, 2020, 8:18 p.m. UTC | #8
On Tue, 17 Mar 2020, 7:16am, Himanshu Madhani wrote:

> On 3/16/2020 1:38 PM, Roman Bolshakov wrote:
> > On Fri, Mar 13, 2020 at 01:50:01AM -0700, Nilesh Javali wrote:
> > > From: Arun Easi <aeasi@marvell.com>
> > > 
> > > I/Os could be passed down while the device FC SCSI device is being
> > > deleted.
> > > This would result in unnecessary delay of I/O and driver messages (when
> > > extended logging is set).
> > > 
> > > Signed-off-by: Arun Easi <aeasi@marvell.com>
> > > ---
> > >   drivers/scsi/qla2xxx/qla_os.c | 4 ++--
> > >   1 file changed, 2 insertions(+), 2 deletions(-)
> > > 
> > 
> > Hi Nilesh, Arun,
> > 
> > Reviewed-by: Roman Bolshakov <r.bolshakov@yadro.com>
> > 
> > Thanks,
> > Roman

Thanks Roman.

> > 
> 
> Thanks Arun. FWIW, I remember this change :)

:) Yep, glad to see you back here, and thanks for the review, Himanshu.

Regards,
-Arun

> 
> Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
> 
>
diff mbox series

Patch

diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index b520a98..7a94e11 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -864,7 +864,7 @@  void qla2xxx_qpair_sp_compl(srb_t *sp, int res)
 		goto qc24_fail_command;
 	}
 
-	if (atomic_read(&fcport->state) != FCS_ONLINE) {
+	if (atomic_read(&fcport->state) != FCS_ONLINE || fcport->deleted) {
 		if (atomic_read(&fcport->state) == FCS_DEVICE_DEAD ||
 			atomic_read(&base_vha->loop_state) == LOOP_DEAD) {
 			ql_dbg(ql_dbg_io, vha, 0x3005,
@@ -946,7 +946,7 @@  void qla2xxx_qpair_sp_compl(srb_t *sp, int res)
 		goto qc24_fail_command;
 	}
 
-	if (atomic_read(&fcport->state) != FCS_ONLINE) {
+	if (atomic_read(&fcport->state) != FCS_ONLINE || fcport->deleted) {
 		if (atomic_read(&fcport->state) == FCS_DEVICE_DEAD ||
 			atomic_read(&base_vha->loop_state) == LOOP_DEAD) {
 			ql_dbg(ql_dbg_io, vha, 0x3077,