Commit a2bfbd42 authored by Neil Brown's avatar Neil Brown Committed by Linus Torvalds

[PATCH] md: fix problems with verion-1 superblock code

- off-by-one error
- missing recalc of checksum
Signed-off-by: default avatarNeil Brown <neilb@cse.unsw.edu.au>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent c564541b
......@@ -935,8 +935,8 @@ static void super_1_sync(mddev_t *mddev, mdk_rdev_t *rdev)
max_dev = 0;
ITERATE_RDEV(mddev,rdev2,tmp)
if (rdev2->desc_nr > max_dev)
max_dev = rdev2->desc_nr;
if (rdev2->desc_nr+1 > max_dev)
max_dev = rdev2->desc_nr+1;
sb->max_dev = cpu_to_le32(max_dev);
for (i=0; i<max_dev;i++)
......@@ -953,6 +953,7 @@ static void super_1_sync(mddev_t *mddev, mdk_rdev_t *rdev)
}
sb->recovery_offset = cpu_to_le64(0); /* not supported yet */
sb->sb_csum = calc_sb_1_csum(sb);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment