Skip to content

Commit

Permalink
[PATCH] md: Make sure array geometry changes persist with version-1 s…
Browse files Browse the repository at this point in the history
…uperblocks

super_1_sync only updates fields in the superblock that might have changed.

'raid_disks' and 'size' could have changed, but this information doesn't get
updated....  until this patch.

Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
neilbrown authored and Linus Torvalds committed Feb 2, 2006
1 parent 6d89332 commit f0ca340
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/md/md.c
Expand Up @@ -1161,6 +1161,9 @@ static void super_1_sync(mddev_t *mddev, mdk_rdev_t *rdev)

sb->cnt_corrected_read = atomic_read(&rdev->corrected_errors);

sb->raid_disks = cpu_to_le32(mddev->raid_disks);
sb->size = cpu_to_le64(mddev->size);

if (mddev->bitmap && mddev->bitmap_file == NULL) {
sb->bitmap_offset = cpu_to_le32((__u32)mddev->bitmap_offset);
sb->feature_map = cpu_to_le32(MD_FEATURE_BITMAP_OFFSET);
Expand Down

0 comments on commit f0ca340

Please sign in to comment.