From: NeilBrown Date: Fri, 9 Sep 2005 23:24:02 +0000 (-0700) Subject: [PATCH] md: really get sb_size setting right in all cases X-Git-Tag: v2.6.14-rc1~228 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=611815651b2640449bda928079160b9263efac1c;p=linux-2.6 [PATCH] md: really get sb_size setting right in all cases 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 Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/md/md.c b/drivers/md/md.c index 8c1f795488..1554b924fb 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -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)); @@ -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<flags);