From: NeilBrown <neilb@cse.unsw.edu.au>

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

From: Paul Clements <Paul.Clements@SteelEye.com>
Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/drivers/md/md.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletion(-)

diff -puN drivers/md/md.c~md-5-of-8-handle-hot-add-for-arrays-with-non-persistent-superblocks drivers/md/md.c
--- 25/drivers/md/md.c~md-5-of-8-handle-hot-add-for-arrays-with-non-persistent-superblocks	2004-05-28 00:22:03.537752952 -0700
+++ 25-akpm/drivers/md/md.c	2004-05-28 00:22:03.543752040 -0700
@@ -2285,7 +2285,12 @@ static int hot_add_disk(mddev_t * mddev,
 		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;
 
_