diff options
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r-- | drivers/md/md.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c index 5c95ccb59500..accae4422c06 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -8075,12 +8075,13 @@ static int md_notify_reboot(struct notifier_block *this, { struct list_head *tmp; mddev_t *mddev; + int need_delay = 0; if ((code == SYS_DOWN) || (code == SYS_HALT) || (code == SYS_POWER_OFF)) { printk(KERN_INFO "md: stopping all md devices.\n"); - for_each_mddev(mddev, tmp) + for_each_mddev(mddev, tmp) { if (mddev_trylock(mddev)) { /* Force a switch to readonly even array * appears to still be in use. Hence @@ -8089,13 +8090,16 @@ static int md_notify_reboot(struct notifier_block *this, md_set_readonly(mddev, 100); mddev_unlock(mddev); } + need_delay = 1; + } /* * certain more exotic SCSI devices are known to be * volatile wrt too early system reboots. While the * right place to handle this issue is the given * driver, we do want to have a safe RAID driver ... */ - mdelay(1000*1); + if (need_delay) + mdelay(1000*1); } return NOTIFY_DONE; } |