diff options
author | Matthew Wilcox <matthew@wil.cx> | 2007-01-15 20:07:09 -0500 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2007-01-27 10:02:36 -0500 |
commit | 938e2ac0b7ac72d264783b0b548eb6078c295294 (patch) | |
tree | ad824377bdef1eea7a945501e432351942c9eab4 /drivers/scsi/scsi_scan.c | |
parent | 7d620a4e531ae4d432d3c88f7d4b75327d881a87 (diff) |
[SCSI] Fix scsi_add_device() for async scanning
I had thought that all drivers which didn't call scsi_scan_host()
called scsi_scan_target(). Some, such as sbp2, mptsas and libata-scsi,
call scsi_add_device() or __scsi_add_device(). We just need to wait
for the currently executing async scans to complete first. This is the
same code that's in scsi_scan_target(), except that we have to return
an error instead of void when we're declining to scan at all.
Signed-off-by: Matthew Wilcox <matthew@wil.cx>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/scsi_scan.c')
-rw-r--r-- | drivers/scsi/scsi_scan.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c index b83d03c4deef..96b7cbd746a8 100644 --- a/drivers/scsi/scsi_scan.c +++ b/drivers/scsi/scsi_scan.c | |||
@@ -1453,6 +1453,12 @@ struct scsi_device *__scsi_add_device(struct Scsi_Host *shost, uint channel, | |||
1453 | struct device *parent = &shost->shost_gendev; | 1453 | struct device *parent = &shost->shost_gendev; |
1454 | struct scsi_target *starget; | 1454 | struct scsi_target *starget; |
1455 | 1455 | ||
1456 | if (strncmp(scsi_scan_type, "none", 4) == 0) | ||
1457 | return ERR_PTR(-ENODEV); | ||
1458 | |||
1459 | if (!shost->async_scan) | ||
1460 | scsi_complete_async_scans(); | ||
1461 | |||
1456 | starget = scsi_alloc_target(parent, channel, id); | 1462 | starget = scsi_alloc_target(parent, channel, id); |
1457 | if (!starget) | 1463 | if (!starget) |
1458 | return ERR_PTR(-ENOMEM); | 1464 | return ERR_PTR(-ENOMEM); |