Commit 65e01fa2 authored by Neil Brown's avatar Neil Brown Committed by Linus Torvalds

[PATCH] md: handle hot-add for arrays with non-persistent superblocks

If the superblock isn't persistent, we shouldn't allow room for it.

From: Paul Clements <Paul.Clements@SteelEye.com>
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 f870229f
......@@ -2251,7 +2251,12 @@ static int hot_add_disk(mddev_t * mddev, dev_t dev)
return -EINVAL;
}
rdev->sb_offset = calc_dev_sboffset(rdev->bdev);
if (mddev->persistent)
rdev->sb_offset = calc_dev_sboffset(rdev->bdev);
else
rdev->sb_offset =
rdev->bdev->bd_inode->i_size >> BLOCK_SIZE_BITS;
size = calc_dev_size(rdev, mddev->chunk_size);
rdev->size = size;
......
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