[PATCH 6/7] initdev:kernel:SCSI asynchronous block init devicenotification

From: David VomLehn
Date: Fri Jun 05 2009 - 23:02:26 EST


In addition to the bus initdev synchronization, SCSI also starts asynchronous
threads with which we must synchronize.

Signed-off-by: David VomLehn <dvomlehn@xxxxxxxxx>
---
drivers/scsi/sd.c | 3 +++
fs/partitions/check.c | 1 +
2 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 8404423..1104892 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -1955,10 +1955,12 @@ static void sd_probe_async(void *data, async_cookie_t cookie)
sd_printk(KERN_NOTICE, sdkp, "Attached SCSI %sdisk\n",
sdp->removable ? "removable " : "");

+ initdev_probe_done(INITDEV_BLOCK_MASK);
return;

out_free_index:
ida_remove(&sd_index_ida, index);
+ initdev_probe_done(INITDEV_BLOCK_MASK);
}

/**
@@ -2026,6 +2028,7 @@ static int sd_probe(struct device *dev)
sdkp->openers = 0;
sdkp->previous_state = 1;

+ initdev_found(INITDEV_BLOCK_MASK);
async_schedule(sd_probe_async, sdkp);

return 0;
diff --git a/fs/partitions/check.c b/fs/partitions/check.c
index 99e33ef..fbc6cd5 100644
--- a/fs/partitions/check.c
+++ b/fs/partitions/check.c
@@ -502,6 +502,7 @@ exit:
while ((part = disk_part_iter_next(&piter)))
kobject_uevent(&part_to_dev(part)->kobj, KOBJ_ADD);
disk_part_iter_exit(&piter);
+ initdev_registered(INITDEV_BLOCK_TYPE);
}

int rescan_partitions(struct gendisk *disk, struct block_device *bdev)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/