diff options
author | Christoph Hellwig <hch@lst.de> | 2006-01-13 13:04:00 -0500 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.(none)> | 2006-01-14 11:55:05 -0500 |
commit | e02f3f59225d8c3b2a0ad0dc941a09865e27da61 (patch) | |
tree | 37d2931f5d24dc063d9606ec6b5e8db359b439c7 /drivers/scsi/scsi_scan.c | |
parent | 6d5b0c315e0c14f8a0fe274eda7676d62cbd8584 (diff) |
[SCSI] remove target parent limitiation
When James Smart fixed the issue of the userspace scan atributes
crashing the system with the FC transport class he added a patch to
let the transport class check if the parent is valid for a given
transport class.
When adding support for the integrated raid of fusion sas devices
we ran into a problem with that, as it didn't allow adding virtual
raid volumes without the transport class knowing about it.
So this patch adds a user_scan attribute instead, that takes over from
scsi_scan_host_selected if the transport class sets it and thus lets
the transport class control the user-initiated scanning. As this
plugs the hole about user-initiated scanning the target_parent hook
goes away and we rely on callers of the scanning routines to do
something sensible.
For SAS this meant I had to switch from a spinlock to a mutex to
synchronize the topology linked lists, in FC they were completely
unsynchronized which seems wrong.
Signed-off-by: Christoph Hellwig <hch@lst.de>
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 | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c index edcd80b749c1..752fb5da3de4 100644 --- a/drivers/scsi/scsi_scan.c +++ b/drivers/scsi/scsi_scan.c | |||
@@ -334,19 +334,6 @@ static struct scsi_target *scsi_alloc_target(struct device *parent, | |||
334 | struct scsi_target *starget; | 334 | struct scsi_target *starget; |
335 | struct scsi_target *found_target; | 335 | struct scsi_target *found_target; |
336 | 336 | ||
337 | /* | ||
338 | * Obtain the real parent from the transport. The transport | ||
339 | * is allowed to fail (no error) if there is nothing at that | ||
340 | * target id. | ||
341 | */ | ||
342 | if (shost->transportt->target_parent) { | ||
343 | spin_lock_irqsave(shost->host_lock, flags); | ||
344 | parent = shost->transportt->target_parent(shost, channel, id); | ||
345 | spin_unlock_irqrestore(shost->host_lock, flags); | ||
346 | if (!parent) | ||
347 | return NULL; | ||
348 | } | ||
349 | |||
350 | starget = kmalloc(size, GFP_KERNEL); | 337 | starget = kmalloc(size, GFP_KERNEL); |
351 | if (!starget) { | 338 | if (!starget) { |
352 | printk(KERN_ERR "%s: allocation failure\n", __FUNCTION__); | 339 | printk(KERN_ERR "%s: allocation failure\n", __FUNCTION__); |
@@ -1283,8 +1270,9 @@ struct scsi_device *__scsi_add_device(struct Scsi_Host *shost, uint channel, | |||
1283 | struct scsi_device *sdev; | 1270 | struct scsi_device *sdev; |
1284 | struct device *parent = &shost->shost_gendev; | 1271 | struct device *parent = &shost->shost_gendev; |
1285 | int res; | 1272 | int res; |
1286 | struct scsi_target *starget = scsi_alloc_target(parent, channel, id); | 1273 | struct scsi_target *starget; |
1287 | 1274 | ||
1275 | starget = scsi_alloc_target(parent, channel, id); | ||
1288 | if (!starget) | 1276 | if (!starget) |
1289 | return ERR_PTR(-ENOMEM); | 1277 | return ERR_PTR(-ENOMEM); |
1290 | 1278 | ||