summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2011-08-25 14:43:08 +1000
committerNeilBrown <neilb@suse.de>2011-08-25 14:43:08 +1000
commitaeb9b211849621f592288ed5ad694de9eeaae87a (patch)
treeaffa418deafe2f218dc84e4aeb6ed4bbaf85d3e5 /drivers
parent5ef56c8fecedf403a346d02140e52a072d693d6b (diff)
downloadlinux-aeb9b211849621f592288ed5ad694de9eeaae87a.tar.bz2
md: ensure changes to 'write-mostly' are reflected in metadata.
The 'write-mostly' flag can be changed through sysfs. With 0.90 metadata, those changes are reflected in the metadata. For 1.x metadata, they aren't. So fix super_1_sync to record 'write-mostly' status. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/md/md.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 1cd9bfb45e9a..9a880239219d 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -1738,6 +1738,11 @@ static void super_1_sync(mddev_t *mddev, mdk_rdev_t *rdev)
sb->level = cpu_to_le32(mddev->level);
sb->layout = cpu_to_le32(mddev->layout);
+ if (test_bit(WriteMostly, &rdev->flags))
+ sb->devflags |= WriteMostly1;
+ else
+ sb->devflags &= ~WriteMostly1;
+
if (mddev->bitmap && mddev->bitmap_info.file == NULL) {
sb->bitmap_offset = cpu_to_le32((__u32)mddev->bitmap_info.offset);
sb->feature_map = cpu_to_le32(MD_FEATURE_BITMAP_OFFSET);