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

Commit 2b12ab6d authored by NeilBrown's avatar NeilBrown Committed by Linus Torvalds
Browse files

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: default avatarNeil Brown <neilb@suse.de>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 8299d7f7
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2714,7 +2714,7 @@ action_show(mddev_t *mddev, char *page)
{
	char *type = "idle";
	if (test_bit(MD_RECOVERY_RUNNING, &mddev->recovery) ||
	    test_bit(MD_RECOVERY_NEEDED, &mddev->recovery)) {
	    (!mddev->ro && test_bit(MD_RECOVERY_NEEDED, &mddev->recovery))) {
		if (test_bit(MD_RECOVERY_RESHAPE, &mddev->recovery))
			type = "reshape";
		else if (test_bit(MD_RECOVERY_SYNC, &mddev->recovery)) {