From: NeilBrown If a raid array was syncing on shutdown, it would hang on shutdown, constantly re-entering md_enter_safemade. This fixes it. --- 25-akpm/drivers/md/md.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletion(-) diff -puN drivers/md/md.c~md-01-shutdown-hang-fix drivers/md/md.c --- 25/drivers/md/md.c~md-01-shutdown-hang-fix Thu Jan 22 16:54:07 2004 +++ 25-akpm/drivers/md/md.c Thu Jan 22 16:54:18 2004 @@ -3106,7 +3106,8 @@ static inline void md_enter_safemode(mdd { 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) && _