Re: [PATCH] scsi: allow state transitions BLOCK -> BLOCK

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2020-07-12 23:19, Hannes Reinecke wrote:
> I think this should be sufficient:
> 
> diff --git a/drivers/scsi/scsi_transport_srp.c
> b/drivers/scsi/scsi_transport_srp.c
> index d4d1104fac99..180b323f46b8 100644
> --- a/drivers/scsi/scsi_transport_srp.c
> +++ b/drivers/scsi/scsi_transport_srp.c
> @@ -404,11 +404,6 @@ static void __rport_fail_io_fast(struct srp_rport
> *rport)
> 
>         if (srp_rport_set_state(rport, SRP_RPORT_FAIL_FAST))
>                 return;
> -       /*
> -        * Call scsi_target_block() to wait for ongoing
> shost->queuecommand()
> -        * calls before invoking i->f->terminate_rport_io().
> -        */
> -       scsi_target_block(rport->dev.parent);
>         scsi_target_unblock(rport->dev.parent, SDEV_TRANSPORT_OFFLINE);
> 
>         /* Involve the LLD if possible to terminate all I/O on the
> rport. */
> @@ -570,8 +565,6 @@ int srp_reconnect_rport(struct srp_rport *rport)
>                  * failure timers if these had not yet been started.
>                  */
>                 __rport_fail_io_fast(rport);
> -               scsi_target_unblock(&shost->shost_gendev,
> -                                   SDEV_TRANSPORT_OFFLINE);
>                 __srp_start_tl_fail_timers(rport);
>         } else if (rport->state != SRP_RPORT_BLOCKED) {
>                 scsi_target_unblock(&shost->shost_gendev,

Adding a comment like this above __rport_fail_io_fast() would be welcome:

/*
 * scsi_target_block() must have been called before this function is
 * called to guarantee that no .queuecommand() calls are in progress.
 */

Otherwise the above patch looks fine to me.

Bart.



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux