From bd12de4e40743d94eb90caad7c49d05e4a045b1e Mon Sep 17 00:00:00 2001 From: Vegard Nossum Date: Wed, 8 Apr 2009 18:05:43 +0200 Subject: [PATCH] scsi: don't wait for async operations in scsi_complete_async_scans() scsi_complete_async_scans() cannot call async_synchronize_full() because it may hold the &shost->scan_mutex (in __scsi_add_device(), for example). I think it was an error to introduce the call to async_synchronize_full() in the first place, because according to scsi_complete_async_scans(), we should only wait for those hosts which have started scanning, and not all of them: /** * scsi_complete_async_scans - Wait for asynchronous scans to complete * * When this function returns, any host which started scanning before * this function was called will have finished its scan. Hosts which * started scanning after this function was called may or may not have * finished. */ Those async calls which have not even started will not count as having started by the scsi code either, so even without this call, we are entirely within the specification of what the function is supposed to do. This should fix the deadlock and not introduce any regressions. Reported-by: Ingo Molnar Signed-off-by: Vegard Nossum --- drivers/scsi/scsi_scan.c | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c index a14d245..6f51ca4 100644 --- a/drivers/scsi/scsi_scan.c +++ b/drivers/scsi/scsi_scan.c @@ -180,8 +180,6 @@ int scsi_complete_async_scans(void) spin_unlock(&async_scan_lock); kfree(data); - /* Synchronize async operations globally */ - async_synchronize_full(); return 0; } -- 1.6.0.6