Re: [PATCH v2 07/12] IB/srp: Avoid that I/O hangs due to a cable pull during LUN scanning

2014-10-21 Thread Christoph Hellwig
On Mon, Oct 20, 2014 at 02:15:07PM +0200, Bart Van Assche wrote: How about renaming this function into shost_sdev_count() and moving its declaration to scsi/scsi_device.h and its implementation to drivers/scsi/scsi_lib.c ? I'd prefer to defer this until we have an actual need for it elsewhere.

Re: [PATCH v2 07/12] IB/srp: Avoid that I/O hangs due to a cable pull during LUN scanning

2014-10-20 Thread Bart Van Assche
On 10/19/14 18:27, Sagi Grimberg wrote: On 10/7/2014 4:05 PM, Bart Van Assche wrote: +static int srp_sdev_count(struct Scsi_Host *host) +{ +struct scsi_device *sdev; +int c = 0; + +shost_for_each_device(sdev, host) +c++; + +return c; +} + Is this really an SRP specific

Re: [PATCH v2 07/12] IB/srp: Avoid that I/O hangs due to a cable pull during LUN scanning

2014-10-19 Thread Sagi Grimberg
On 10/7/2014 4:05 PM, Bart Van Assche wrote: If a cable is pulled during LUN scanning it can happen that the SRP rport and the SCSI host have been created but no LUNs have been added to the SCSI host. Since multipathd only sends SCSI commands to a SCSI target if one or more SCSI devices are

[PATCH v2 07/12] IB/srp: Avoid that I/O hangs due to a cable pull during LUN scanning

2014-10-07 Thread Bart Van Assche
If a cable is pulled during LUN scanning it can happen that the SRP rport and the SCSI host have been created but no LUNs have been added to the SCSI host. Since multipathd only sends SCSI commands to a SCSI target if one or more SCSI devices are present and since there is no keepalive mechanism