public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/2] [SCSI] ibmvscsi: Fix SCSI scanning
@ 2011-06-19 11:48 Bart Van Assche
  2011-06-20 11:40 ` Christoph Hellwig
  2011-06-20 19:06 ` Brian King
  0 siblings, 2 replies; 5+ messages in thread
From: Bart Van Assche @ 2011-06-19 11:48 UTC (permalink / raw)
  To: linux-scsi; +Cc: Brian King, Fujita Tomonori

Avoid that SCSI scanning triggers creation of targets with a non-zero
channel number.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Cc: Brian King <brking@linux.vnet.ibm.com>
Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: <stable@kernel.org>
---
 drivers/scsi/ibmvscsi/ibmvscsi.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

Note: this patch hasn't been tested yet.

diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c b/drivers/scsi/ibmvscsi/ibmvscsi.c
index 3d391dc..c31adf5 100644
--- a/drivers/scsi/ibmvscsi/ibmvscsi.c
+++ b/drivers/scsi/ibmvscsi/ibmvscsi.c
@@ -498,6 +498,11 @@ static void purge_requests(struct ibmvscsi_host_data *hostdata, int error_code)
 	spin_unlock_irqrestore(hostdata->host->host_lock, flags);
 }
 
+static int ibmvscsi_target_alloc(struct scsi_target *starget)
+{
+	return starget->channel == 0 ? 0 : -ENODEV;
+}
+
 /**
  * ibmvscsi_reset_host - Reset the connection to the server
  * @hostdata:	struct ibmvscsi_host_data to reset
@@ -1803,6 +1808,7 @@ static struct scsi_host_template driver_template = {
 	.module = THIS_MODULE,
 	.name = "IBM POWER Virtual SCSI Adapter " IBMVSCSI_VERSION,
 	.proc_name = "ibmvscsi",
+	.target_alloc = ibmvscsi_target_alloc,
 	.queuecommand = ibmvscsi_queuecommand,
 	.eh_abort_handler = ibmvscsi_eh_abort_handler,
 	.eh_device_reset_handler = ibmvscsi_eh_device_reset_handler,
-- 
1.7.3.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-06-20 19:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-19 11:48 [PATCH 2/2] [SCSI] ibmvscsi: Fix SCSI scanning Bart Van Assche
2011-06-20 11:40 ` Christoph Hellwig
2011-06-20 17:58   ` Bart Van Assche
2011-06-20 19:10     ` Brian King
2011-06-20 19:06 ` Brian King

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox