mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
block: Fix dev_t minor allocation lifetime
Releases the dev_t minor when all references are closed to prevent another device from acquiring the same major/minor. Since the partition's release may be invoked from call_rcu's soft-irq context, the ext_dev_idr's mutex had to be replaced with a spinlock so as not so sleep. Signed-off-by: Keith Busch <[email protected]> Cc: [email protected] Signed-off-by: Jens Axboe <[email protected]>
This commit is contained in:
parent
5676e7b6db
commit
2da78092dd
2 changed files with 15 additions and 11 deletions
|
|
@ -211,6 +211,7 @@ static const struct attribute_group *part_attr_groups[] = {
|
|||
static void part_release(struct device *dev)
|
||||
{
|
||||
struct hd_struct *p = dev_to_part(dev);
|
||||
blk_free_devt(dev->devt);
|
||||
free_part_stats(p);
|
||||
free_part_info(p);
|
||||
kfree(p);
|
||||
|
|
@ -253,7 +254,6 @@ void delete_partition(struct gendisk *disk, int partno)
|
|||
rcu_assign_pointer(ptbl->last_lookup, NULL);
|
||||
kobject_put(part->holder_dir);
|
||||
device_del(part_to_dev(part));
|
||||
blk_free_devt(part_devt(part));
|
||||
|
||||
hd_struct_put(part);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue