Skip to content

Commit

Permalink
[PATCH] md: really get sb_size setting right in all cases
Browse files Browse the repository at this point in the history
There was another case where sb_size wasn't being set, so instead do the
sensible thing and set if when filling in the content of a superblock.  That
ensures that whenever we write a superblock, the sb_size MUST be set.

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 Sep 9, 2005
1 parent 188c18f commit 6118156
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/md/md.c
Original file line number Diff line number Diff line change
Expand Up @@ -712,6 +712,8 @@ static void super_90_sync(mddev_t *mddev, mdk_rdev_t *rdev)
int i;
int active=0, working=0,failed=0,spare=0,nr_disks=0;

rdev->sb_size = MD_SB_BYTES;

sb = (mdp_super_t*)page_address(rdev->sb_page);

memset(sb, 0, sizeof(*sb));
Expand Down Expand Up @@ -2303,8 +2305,6 @@ static int add_new_disk(mddev_t * mddev, mdu_disk_info_t *info)
else
rdev->in_sync = 0;

rdev->sb_size = MD_SB_BYTES;

if (info->state & (1<<MD_DISK_WRITEMOSTLY))
set_bit(WriteMostly, &rdev->flags);

Expand Down

0 comments on commit 6118156

Please sign in to comment.