aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2011-08-25 00:43:08 -0400
committerNeilBrown <neilb@suse.de>2011-08-25 00:43:08 -0400
commitaeb9b211849621f592288ed5ad694de9eeaae87a (patch)
treeaffa418deafe2f218dc84e4aeb6ed4bbaf85d3e5 /drivers/md
parent5ef56c8fecedf403a346d02140e52a072d693d6b (diff)
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/md')
-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)
1738 sb->level = cpu_to_le32(mddev->level); 1738 sb->level = cpu_to_le32(mddev->level);
1739 sb->layout = cpu_to_le32(mddev->layout); 1739 sb->layout = cpu_to_le32(mddev->layout);
1740 1740
1741 if (test_bit(WriteMostly, &rdev->flags))
1742 sb->devflags |= WriteMostly1;
1743 else
1744 sb->devflags &= ~WriteMostly1;
1745
1741 if (mddev->bitmap && mddev->bitmap_info.file == NULL) { 1746 if (mddev->bitmap && mddev->bitmap_info.file == NULL) {
1742 sb->bitmap_offset = cpu_to_le32((__u32)mddev->bitmap_info.offset); 1747 sb->bitmap_offset = cpu_to_le32((__u32)mddev->bitmap_info.offset);
1743 sb->feature_map = cpu_to_le32(MD_FEATURE_BITMAP_OFFSET); 1748 sb->feature_map = cpu_to_le32(MD_FEATURE_BITMAP_OFFSET);