diff mbox

[1/2] IB/srp: Fix SCSI scanning

Message ID BANLkTinVL6AVLipCwdeAbhZ1JY064KZOYA@mail.gmail.com (mailing list archive)
State Superseded
Delegated to: David Dillow
Headers show

Commit Message

Bart Van Assche June 20, 2011, 5:53 p.m. UTC
On Mon, Jun 20, 2011 at 1:37 PM, Christoph Hellwig <hch@infradead.org> wrote:
> We really shouldn't require workaround for this in every SCSI driver.
>
> scsi_scan_host_selected already makes sure never to scan above
> shost->max_channel.  Could it be that you don't have that one set
> properly in the srp driver?  It not we'll need to debug why it happens
> instead of adding hacks like this.

As far as I can see the default value for max_channel is zero. The patch
below also avoids creation of duplicate SCSI targets on my setup.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>

---
 drivers/infiniband/ulp/srp/ib_srp.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
diff mbox

Patch

diff --git a/drivers/infiniband/ulp/srp/ib_srp.c
b/drivers/infiniband/ulp/srp/ib_srp.c
index ee165fd..4ab1271 100644
--- a/drivers/infiniband/ulp/srp/ib_srp.c
+++ b/drivers/infiniband/ulp/srp/ib_srp.c
@@ -2127,6 +2127,7 @@  static ssize_t srp_create_target(struct device *dev,
 		return -ENOMEM;

 	target_host->transportt  = ib_srp_transport_template;
+	target_host->max_id      = 1;
 	target_host->max_lun     = SRP_MAX_LUN;
 	target_host->max_cmd_len = sizeof ((struct srp_cmd *) (void *) 0L)->cdb;