mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
block: do_mounts - accept root=<non-existant partition>
Some devices, like md, may create partitions only at first access, so allow root= to be set to a valid non-existant partition of an existing disk. This applies only to non-initramfs root mounting. This fixes a regression from 2.6.24 which did allow this to happen and broke some users machines :( Acked-by: Neil Brown <[email protected]> Tested-by: Joao Luis Meloni Assirati <[email protected]> Cc: stable <[email protected]> Signed-off-by: Kay Sievers <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
9604006d28
commit
30f2f0eb4b
3 changed files with 34 additions and 6 deletions
|
|
@ -653,7 +653,7 @@ void genhd_media_change_notify(struct gendisk *disk)
|
|||
EXPORT_SYMBOL_GPL(genhd_media_change_notify);
|
||||
#endif /* 0 */
|
||||
|
||||
dev_t blk_lookup_devt(const char *name)
|
||||
dev_t blk_lookup_devt(const char *name, int part)
|
||||
{
|
||||
struct device *dev;
|
||||
dev_t devt = MKDEV(0, 0);
|
||||
|
|
@ -661,7 +661,11 @@ dev_t blk_lookup_devt(const char *name)
|
|||
mutex_lock(&block_class_lock);
|
||||
list_for_each_entry(dev, &block_class.devices, node) {
|
||||
if (strcmp(dev->bus_id, name) == 0) {
|
||||
devt = dev->devt;
|
||||
struct gendisk *disk = dev_to_disk(dev);
|
||||
|
||||
if (part < disk->minors)
|
||||
devt = MKDEV(MAJOR(dev->devt),
|
||||
MINOR(dev->devt) + part);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -669,7 +673,6 @@ dev_t blk_lookup_devt(const char *name)
|
|||
|
||||
return devt;
|
||||
}
|
||||
|
||||
EXPORT_SYMBOL(blk_lookup_devt);
|
||||
|
||||
struct gendisk *alloc_disk(int minors)
|
||||
|
|
|
|||
Loading…
Reference in a new issue