diff options
author | Neil Brown <neilb@suse.de> | 2009-02-18 04:33:59 -0500 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2009-02-18 04:33:59 -0500 |
commit | 41b8c853a495438208faa5be03bbb0050859163b (patch) | |
tree | 912541723b38a52c68c46bdb1de567972e239594 | |
parent | 78f707bfc723552e8309b7c38a8d0cc51012e813 (diff) |
block: fix booting from partitioned md array
Hi Tejun,
it looks like your commit:
block: don't depend on consecutive minor space
f331c0296f2a9fee0d396a70598b954062603015
broke a particular case for booting from partitioned md/raid devices.
That is the second time this has been broken recently. The previous
time was fixed by
block: do_mounts - accept root=<non-existant partition>
30f2f0eb4bd2c43d10a8b0d872c6e5ad8f31c9a0
Because the data isn't available when an md device is first created
(we add disks and set it up after creation), the initial partition
scan finds nothing. It is not until the device is opened that
another partition scan happens and finds something.
So at the point where the kernel parameter "root=/dev/md_d0p1" is
being parsed, md_d0 exists, but md_d0p1 does not.
However if we let blk_lookup_devt return the correct device number
even though the device doesn't exist, then the attempt to mount it
will successfully find the partition.
I have tried in the past to find a way to get the partition table to
be read as soon as the array is assembled but that proved impossible
(at the time). I don't remember the details, and could possibly
revisit it. However it would be really nice if blk_lookup_devt
could be adjusted to again accept non existant partitions.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
-rw-r--r-- | block/genhd.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/block/genhd.c b/block/genhd.c index 397960cf26af..e1eadcc9546a 100644 --- a/block/genhd.c +++ b/block/genhd.c | |||
@@ -1087,6 +1087,14 @@ dev_t blk_lookup_devt(const char *name, int partno) | |||
1087 | if (strcmp(dev_name(dev), name)) | 1087 | if (strcmp(dev_name(dev), name)) |
1088 | continue; | 1088 | continue; |
1089 | 1089 | ||
1090 | if (partno < disk->minors) { | ||
1091 | /* We need to return the right devno, even | ||
1092 | * if the partition doesn't exist yet. | ||
1093 | */ | ||
1094 | devt = MKDEV(MAJOR(dev->devt), | ||
1095 | MINOR(dev->devt) + partno); | ||
1096 | break; | ||
1097 | } | ||
1090 | part = disk_get_part(disk, partno); | 1098 | part = disk_get_part(disk, partno); |
1091 | if (part) { | 1099 | if (part) { |
1092 | devt = part_devt(part); | 1100 | devt = part_devt(part); |