diff options
author | NeilBrown <neilb@suse.de> | 2007-10-17 02:30:53 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-17 11:43:03 -0400 |
commit | 2b12ab6d33f413aabb623197eeecaad5c216e6ae (patch) | |
tree | 5fffaf905d8495d54bfb82fc6be080c3b292e391 | |
parent | 8299d7f7c067a30a67ad359d416128c4ff57dcd1 (diff) |
md: 'sync_action' in sysfs returns wrong value for readonly arrays
When an array is started read-only, MD_RECOVERY_NEEDED can be set but no
recovery will be running. This causes 'sync_action' to report the wrong
value.
We could remove the test for MD_RECOVERY_NEEDED, but doing so would leave a
small gap after requesting a sync action, where 'sync_action' would still
report the old value.
So make sure that for a read-only array, 'sync_action' always returns 'idle'.
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | drivers/md/md.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c index f173ace1f8fb..510625e3a965 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
@@ -2714,7 +2714,7 @@ action_show(mddev_t *mddev, char *page) | |||
2714 | { | 2714 | { |
2715 | char *type = "idle"; | 2715 | char *type = "idle"; |
2716 | if (test_bit(MD_RECOVERY_RUNNING, &mddev->recovery) || | 2716 | if (test_bit(MD_RECOVERY_RUNNING, &mddev->recovery) || |
2717 | test_bit(MD_RECOVERY_NEEDED, &mddev->recovery)) { | 2717 | (!mddev->ro && test_bit(MD_RECOVERY_NEEDED, &mddev->recovery))) { |
2718 | if (test_bit(MD_RECOVERY_RESHAPE, &mddev->recovery)) | 2718 | if (test_bit(MD_RECOVERY_RESHAPE, &mddev->recovery)) |
2719 | type = "reshape"; | 2719 | type = "reshape"; |
2720 | else if (test_bit(MD_RECOVERY_SYNC, &mddev->recovery)) { | 2720 | else if (test_bit(MD_RECOVERY_SYNC, &mddev->recovery)) { |