Commit d1ca66cc authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] md: Fix possible hang in raid shutdown.

From: NeilBrown <neilb@cse.unsw.edu.au>

If a raid array was syncing on shutdown, it would hang on shutdown,
constantly re-entering md_enter_safemade.  This fixes it.
parent ced9eac2
......@@ -3106,7 +3106,8 @@ static inline void md_enter_safemode(mddev_t *mddev)
{
if (!mddev->safemode) return;
if (mddev->safemode == 2 &&
(atomic_read(&mddev->writes_pending) || mddev->in_sync))
(atomic_read(&mddev->writes_pending) || mddev->in_sync ||
mddev->recovery_cp != MaxSector))
return; /* avoid the lock */
mddev_lock_uninterruptible(mddev);
if (mddev->safemode && !atomic_read(&mddev->writes_pending) &&
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment