diff options
author | NeilBrown <neilb@suse.de> | 2012-10-10 23:19:39 -0400 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2012-10-10 23:19:39 -0400 |
commit | 48c26ddc9f85808632a63b3ae50b868c86a2435f (patch) | |
tree | 2d4f5d9f299f4be2c7b137655a0daae01e659a9a /drivers/md | |
parent | 7f7583d420231b9d09897afd57a957011b606a5b (diff) |
md: writing to sync_action should clear the read-auto state.
In some cases array are started in 'read-auto' state where in
nothing gets written to any device until the array is written
to. The purpose of this is to make accidental auto-assembly
of the wrong arrays less of a risk, and to allow arrays to be
started to read suspend-to-disk images without actually changing
anything (as might happen if the array were dirty and a
resync seemed necessary).
Explicitly writing the 'sync_action' for a read-auto array currently
doesn't clear the read-auto state, so the sync action doesn't
happen, which can be confusing.
So allow any successful write to sync_action to clear any read-auto
state.
Reported-by: Alexander Kühn <alexander.kuehn@nagilum.de>
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md')
-rw-r--r-- | drivers/md/md.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c index 7564c44b8045..200d0862335f 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
@@ -4259,6 +4259,13 @@ action_store(struct mddev *mddev, const char *page, size_t len) | |||
4259 | set_bit(MD_RECOVERY_REQUESTED, &mddev->recovery); | 4259 | set_bit(MD_RECOVERY_REQUESTED, &mddev->recovery); |
4260 | set_bit(MD_RECOVERY_SYNC, &mddev->recovery); | 4260 | set_bit(MD_RECOVERY_SYNC, &mddev->recovery); |
4261 | } | 4261 | } |
4262 | if (mddev->ro == 2) { | ||
4263 | /* A write to sync_action is enough to justify | ||
4264 | * canceling read-auto mode | ||
4265 | */ | ||
4266 | mddev->ro = 0; | ||
4267 | md_wakeup_thread(mddev->sync_thread); | ||
4268 | } | ||
4262 | set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); | 4269 | set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); |
4263 | md_wakeup_thread(mddev->thread); | 4270 | md_wakeup_thread(mddev->thread); |
4264 | sysfs_notify_dirent_safe(mddev->sysfs_action); | 4271 | sysfs_notify_dirent_safe(mddev->sysfs_action); |