aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/md.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@cse.unsw.edu.au>2005-09-09 19:23:50 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-09-09 19:39:11 -0400
commit7b1e35f6d666693e8f376ce02242efca3ec09aaf (patch)
treec471a526b69594ce1bd7daa44ab50c51a0c6bfcf /drivers/md/md.c
parent3178b0dbdf67322f6506582e494bdf553cc85c32 (diff)
[PATCH] md: allow hot-adding devices to arrays with non-persistant superblocks.
It is possibly (and occasionally useful) to have a raid1 without persistent superblocks. The code in add_new_disk for adding a device to such an array always tries to read a superblock. This will obviously fail. So do the appropriate test and call md_import_device with appropriate args. Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r--drivers/md/md.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index f1ac356e656d..866c704e008a 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -2226,8 +2226,11 @@ static int add_new_disk(mddev_t * mddev, mdu_disk_info_t *info)
2226 mdname(mddev)); 2226 mdname(mddev));
2227 return -EINVAL; 2227 return -EINVAL;
2228 } 2228 }
2229 rdev = md_import_device(dev, mddev->major_version, 2229 if (mddev->persistent)
2230 mddev->minor_version); 2230 rdev = md_import_device(dev, mddev->major_version,
2231 mddev->minor_version);
2232 else
2233 rdev = md_import_device(dev, -1, -1);
2231 if (IS_ERR(rdev)) { 2234 if (IS_ERR(rdev)) {
2232 printk(KERN_WARNING 2235 printk(KERN_WARNING
2233 "md: md_import_device returned %ld\n", 2236 "md: md_import_device returned %ld\n",