summaryrefslogtreecommitdiffstats
path: root/drivers/md
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2006-07-10 13:44:14 +0200
committerLinus Torvalds <torvalds@g5.osdl.org>2006-07-10 22:24:16 +0200
commit31b65a0d3894566191b91fbadd122c354a363b5d (patch)
tree42836c0798c1a85d7bf1551a22293476cb70601e /drivers/md
parent[PATCH] md: possible fix for unplug problem (diff)
downloadlinux-31b65a0d3894566191b91fbadd122c354a363b5d.tar.xz
linux-31b65a0d3894566191b91fbadd122c354a363b5d.zip
[PATCH] md: set desc_nr correctly for version-1 superblocks
This has to be done in ->load_super, not ->validate_super Without this, hot-adding devices to an array doesn't always work right - though there is a work around in mdadm-2.5.2 to make this less of an issue. Signed-off-by: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/md.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index e4e161372a3e..9f76e0cd7805 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -1062,6 +1062,11 @@ static int super_1_load(mdk_rdev_t *rdev, mdk_rdev_t *refdev, int minor_version)
if (rdev->sb_size & bmask)
rdev-> sb_size = (rdev->sb_size | bmask)+1;
+ if (sb->level == cpu_to_le32(LEVEL_MULTIPATH))
+ rdev->desc_nr = -1;
+ else
+ rdev->desc_nr = le32_to_cpu(sb->dev_number);
+
if (refdev == 0)
ret = 1;
else {
@@ -1171,7 +1176,6 @@ static int super_1_validate(mddev_t *mddev, mdk_rdev_t *rdev)
}
if (mddev->level != LEVEL_MULTIPATH) {
int role;
- rdev->desc_nr = le32_to_cpu(sb->dev_number);
role = le16_to_cpu(sb->dev_roles[rdev->desc_nr]);
switch(role) {
case 0xffff: /* spare */