mirror of https://github.com/torvalds/linux.git
md: remove legacy 1s delay in md_notify_reboot
During system shutdown, the md driver registered notifier function (md_notify_reboot) currently imposes a hardcoded one-second delay. This delay was introduced approximately 23 years ago and was likely necessary for the hardware generation of that time. Proposing this patch to make sure there are no known devices that need this delay. Link: https://lore.kernel.org/linux-raid/20251121191422.2758555-1-tarunsahu@google.com Signed-off-by: Tarun Sahu <tarunsahu@google.com> Reviewed-by: Yu Kuai<yukuai@fnnas.com> Signed-off-by: Yu Kuai <yukuai@fnnas.com>
This commit is contained in:
parent
a913d1f6a7
commit
fdd0c6a649
|
|
@ -10408,7 +10408,6 @@ static int md_notify_reboot(struct notifier_block *this,
|
||||||
unsigned long code, void *x)
|
unsigned long code, void *x)
|
||||||
{
|
{
|
||||||
struct mddev *mddev;
|
struct mddev *mddev;
|
||||||
int need_delay = 0;
|
|
||||||
|
|
||||||
spin_lock(&all_mddevs_lock);
|
spin_lock(&all_mddevs_lock);
|
||||||
list_for_each_entry(mddev, &all_mddevs, all_mddevs) {
|
list_for_each_entry(mddev, &all_mddevs, all_mddevs) {
|
||||||
|
|
@ -10422,21 +10421,11 @@ static int md_notify_reboot(struct notifier_block *this,
|
||||||
mddev->safemode = 2;
|
mddev->safemode = 2;
|
||||||
mddev_unlock(mddev);
|
mddev_unlock(mddev);
|
||||||
}
|
}
|
||||||
need_delay = 1;
|
|
||||||
spin_lock(&all_mddevs_lock);
|
spin_lock(&all_mddevs_lock);
|
||||||
mddev_put_locked(mddev);
|
mddev_put_locked(mddev);
|
||||||
}
|
}
|
||||||
spin_unlock(&all_mddevs_lock);
|
spin_unlock(&all_mddevs_lock);
|
||||||
|
|
||||||
/*
|
|
||||||
* 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 ...
|
|
||||||
*/
|
|
||||||
if (need_delay)
|
|
||||||
msleep(1000);
|
|
||||||
|
|
||||||
return NOTIFY_DONE;
|
return NOTIFY_DONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue