aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/md.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2014-01-13 23:17:03 -0500
committerNeilBrown <neilb@suse.de>2014-01-14 00:44:21 -0500
commit830778a180f268ac106f072b8aad793a79088c87 (patch)
treee828d1bb71af9743b4912c0bc1b1f8056d7328da /drivers/md/md.c
parent0b59bb6422e43ad0534073e2cbc4d0f52720da88 (diff)
md: ensure metadata is writen after raid level change.
level_store() currently does not make sure the metadata is updates to reflect the new raid level. It simply sets MD_CHANGE_DEVS. Any level with a ->thread will quickly notice this and update the metadata. However RAID0 and Linear do not have a thread so no metadata update happens until the array is stopped. At that point the metadata is written. This is later that we would like. While the delay doesn't risk any data it can cause confusion. So if there is no md thread, immediately update the metadata after a level change. Reported-by: Richard Michael <rmichael@edgeofthenet.org> Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r--drivers/md/md.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 757e388308a8..a20b7806de7a 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -3611,6 +3611,8 @@ level_store(struct mddev *mddev, const char *buf, size_t len)
3611 pers->run(mddev); 3611 pers->run(mddev);
3612 set_bit(MD_CHANGE_DEVS, &mddev->flags); 3612 set_bit(MD_CHANGE_DEVS, &mddev->flags);
3613 mddev_resume(mddev); 3613 mddev_resume(mddev);
3614 if (!mddev->thread)
3615 md_update_sb(mddev, 1);
3614 sysfs_notify(&mddev->kobj, NULL, "level"); 3616 sysfs_notify(&mddev->kobj, NULL, "level");
3615 md_new_event(mddev); 3617 md_new_event(mddev);
3616 return rv; 3618 return rv;