Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

md: fix safe_mode buglet.

Whe we set the safe_mode_timeout to a smaller value we trigger a timeout
immediately - otherwise the small value might not be honoured.
However if the previous timeout was 0 meaning "no timeout", we didn't.
This would mean that no timeout happens until the next write completes,
which could be a long time.

Signed-off-by: NeilBrown <neilb@suse.de>

NeilBrown 275c51c4 60559da4

+1 -1
+1 -1
drivers/md/md.c
··· 3429 3429 mddev->safemode_delay = (msec*HZ)/1000; 3430 3430 if (mddev->safemode_delay == 0) 3431 3431 mddev->safemode_delay = 1; 3432 - if (mddev->safemode_delay < old_delay) 3432 + if (mddev->safemode_delay < old_delay || old_delay == 0) 3433 3433 md_safemode_timeout((unsigned long)mddev); 3434 3434 } 3435 3435 return len;