Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 005eca5e authored by NeilBrown's avatar NeilBrown Committed by Linus Torvalds
Browse files

[PATCH] md: make sure resync gets started when array starts.



We weren't actually waking up the md thread after setting
MD_RECOVERY_NEEDED when assembling an array, so it is possible to lose a
race and not actually start resync.

So add a call to md_wakeup_thread, and while we are at it, remove all the
"if (mddev->thread)" guards as md_wake_thread does its own checking.

Signed-off-by: default avatarNeil Brown <neilb@cse.unsw.edu.au>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 4c5640cb
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -256,7 +256,6 @@ static inline void mddev_unlock(mddev_t * mddev)
{
	up(&mddev->reconfig_sem);

	if (mddev->thread)
	md_wakeup_thread(mddev->thread);
}

@@ -1714,6 +1713,7 @@ static int do_md_run(mddev_t * mddev)
	mddev->in_sync = 1;
	
	set_bit(MD_RECOVERY_NEEDED, &mddev->recovery);
	md_wakeup_thread(mddev->thread);
	
	if (mddev->sb_dirty)
		md_update_sb(mddev);
@@ -2236,7 +2236,6 @@ static int add_new_disk(mddev_t * mddev, mdu_disk_info_t *info)
			export_rdev(rdev);

		set_bit(MD_RECOVERY_NEEDED, &mddev->recovery);
		if (mddev->thread)
		md_wakeup_thread(mddev->thread);
		return err;
	}