Avoid that SCSI scanning triggers creation of targets with a non-zero channel number. Signed-off-by: Bart Van Assche <bvanassche@xxxxxxx> Cc: Brian King <brking@xxxxxxxxxxxxxxxxxx> Cc: FUJITA Tomonori <fujita.tomonori@xxxxxxxxxxxxx> Cc: <stable@xxxxxxxxxx> --- 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 -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html