From 03c902e17f40cfed63cd2494616f35fc9c58571b Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Fri, 6 Jan 2006 00:20:46 -0800 Subject: [PATCH] md: fix rdev->pending counts in raid1 When we do a user-requested check/repair, we lose count of the outstanding requests... Also make sure that when anything is written to md/sync_action, the RECOVERY_NEEDED flag is set and the thread is woken up so any changes take effect. Signed-off-by: Neil Brown Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/md/md.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'drivers/md/md.c') diff --git a/drivers/md/md.c b/drivers/md/md.c index 241d514343c..0b3081aa4d6 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -1826,13 +1826,10 @@ action_store(mddev_t *mddev, const char *page, size_t len) mddev->sync_thread = NULL; mddev->recovery = 0; } - return len; - } - - if (test_bit(MD_RECOVERY_RUNNING, &mddev->recovery) || - test_bit(MD_RECOVERY_NEEDED, &mddev->recovery)) + } else if (test_bit(MD_RECOVERY_RUNNING, &mddev->recovery) || + test_bit(MD_RECOVERY_NEEDED, &mddev->recovery)) return -EBUSY; - if (cmd_match(page, "resync") || cmd_match(page, "recover")) + else if (cmd_match(page, "resync") || cmd_match(page, "recover")) set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); else { if (cmd_match(page, "check")) @@ -1841,8 +1838,8 @@ action_store(mddev_t *mddev, const char *page, size_t len) return -EINVAL; set_bit(MD_RECOVERY_REQUESTED, &mddev->recovery); set_bit(MD_RECOVERY_SYNC, &mddev->recovery); - set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); } + set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); md_wakeup_thread(mddev->thread); return len; } -- cgit v1.2.3-18-g5258