diff options
-rw-r--r-- | drivers/md/md.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c index c7aae66c6f9b..48afe4f7ad4c 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
@@ -2393,6 +2393,8 @@ static void analyze_sbs(mddev_t * mddev) | |||
2393 | 2393 | ||
2394 | } | 2394 | } |
2395 | 2395 | ||
2396 | static void md_safemode_timeout(unsigned long data); | ||
2397 | |||
2396 | static ssize_t | 2398 | static ssize_t |
2397 | safe_delay_show(mddev_t *mddev, char *page) | 2399 | safe_delay_show(mddev_t *mddev, char *page) |
2398 | { | 2400 | { |
@@ -2432,9 +2434,12 @@ safe_delay_store(mddev_t *mddev, const char *cbuf, size_t len) | |||
2432 | if (msec == 0) | 2434 | if (msec == 0) |
2433 | mddev->safemode_delay = 0; | 2435 | mddev->safemode_delay = 0; |
2434 | else { | 2436 | else { |
2437 | unsigned long old_delay = mddev->safemode_delay; | ||
2435 | mddev->safemode_delay = (msec*HZ)/1000; | 2438 | mddev->safemode_delay = (msec*HZ)/1000; |
2436 | if (mddev->safemode_delay == 0) | 2439 | if (mddev->safemode_delay == 0) |
2437 | mddev->safemode_delay = 1; | 2440 | mddev->safemode_delay = 1; |
2441 | if (mddev->safemode_delay < old_delay) | ||
2442 | md_safemode_timeout((unsigned long)mddev); | ||
2438 | } | 2443 | } |
2439 | return len; | 2444 | return len; |
2440 | } | 2445 | } |