Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a57b1fccdfa65b78481f5e651833d979e545de04
Commit:     a57b1fccdfa65b78481f5e651833d979e545de04
Parent:     31765d7d3da9bb575f80faecae0b931afa3532c6
Author:     Matthew Wilcox <[EMAIL PROTECTED]>
AuthorDate: Mon Aug 20 09:18:48 2007 -0600
Committer:  James Bottomley <[EMAIL PROTECTED]>
CommitDate: Fri Oct 12 14:51:06 2007 -0400

    [SCSI] scsi_scan: Cope with kthread_run failing
    
    If kthread_run failed, we would fail to scan the host, and leak the
    allocated async_scan_data.  Since using a separate thread is just an
    optimisation, do the scan synchronously if we fail to spawn a thread.
    
    Signed-off-by: Matthew Wilcox <[EMAIL PROTECTED]>
    Signed-off-by: James Bottomley <[EMAIL PROTECTED]>
---
 drivers/scsi/scsi_scan.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
index 20df7fe..b53c5f6 100644
--- a/drivers/scsi/scsi_scan.c
+++ b/drivers/scsi/scsi_scan.c
@@ -1799,6 +1799,7 @@ static int do_scan_async(void *_data)
  **/
 void scsi_scan_host(struct Scsi_Host *shost)
 {
+       struct task_struct *p;
        struct async_scan_data *data;
 
        if (strncmp(scsi_scan_type, "none", 4) == 0)
@@ -1810,7 +1811,9 @@ void scsi_scan_host(struct Scsi_Host *shost)
                return;
        }
 
-       kthread_run(do_scan_async, data, "scsi_scan_%d", shost->host_no);
+       p = kthread_run(do_scan_async, data, "scsi_scan_%d", shost->host_no);
+       if (unlikely(IS_ERR(p)))
+               do_scan_async(data);
 }
 EXPORT_SYMBOL(scsi_scan_host);
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to