[SCSI] Add missing completion to scsi_complete_async_scans()
authorMatthew Wilcox <matthew@wil.cx>
Fri, 8 Dec 2006 02:29:27 +0000 (19:29 -0700)
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>
Wed, 3 Jan 2007 22:57:31 +0000 (16:57 -0600)
commit8bcc24127be12967588db0ad0e614be937ee1d5a
tree1cf09463b1ba851985d88d3da4ba1ff5a4af6192
parent23be331d9e5077edf07d73813f870d3b895c8593
[SCSI] Add missing completion to scsi_complete_async_scans()

If either scsi_complete_async_scans() is called a second time
before the first call has finished, or a host scan is started while
scsi_complete_async_scans() is still sleeping, it would fail to wake up
the other task, which would sleep forever.

I've changed the kernel-doc to make it clear that
scsi_complete_async_scans() only guarantees that scans which started
before it was called are guaranteed to have finished when it returns.
I considered making it wait until all scans are completed, but it can't
guarantee that no more scans will start before it returns anyway, and it
runs the risk of confusing other callers of scsi_complete_async_scans()
for hosts actually scanning.

Signed-off-by: Matthew Wilcox <matthew@wil.cx>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
drivers/scsi/scsi_scan.c