diff options
author | Keith Busch <keith.busch@intel.com> | 2014-08-26 09:05:36 -0600 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2014-11-05 20:27:40 +0000 |
commit | a288cafeceb6e18ba4fd10ec8d3270593472cca6 (patch) | |
tree | 3ec11e6f9758e5620b7d4f8ad55bc77ba9dd8083 /fs | |
parent | 1cc8e21690688b24b0b9388dbb14e1d2cf4f94b4 (diff) |
block: Fix dev_t minor allocation lifetime
commit 2da78092dda13f1efd26edbbf99a567776913750 upstream.
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 <keith.busch@intel.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
[bwh: Backported to 3.2:
- Adjust filename
- idr insertion API is different, and blk_alloc_devt() is preallocating
a node in a different way]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/partitions/check.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/partitions/check.c b/fs/partitions/check.c index 1ef15cce157a..18c58e5c7260 100644 --- a/fs/partitions/check.c +++ b/fs/partitions/check.c @@ -361,6 +361,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); @@ -403,7 +404,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); } |