author: Christoph Hellwig <hch@lst.de> 2021-07-01 10:16:37 +0200
committer: Greg Kroah-Hartman <gregkh@linuxfoundation.org> 2021-07-20 16:00:31 +0200
commit: 04c529ed0e7f40848869e0dc8c4f9b7c51d9133e
parent: ccdf7e073170886bc370c613e269de610a794c4a
Commit Summary:
Diffstat:
1 file changed, 2 insertions, 2 deletions
diff --git a/block/genhd.c b/block/genhd.c
index 9f8cb7beaad1..ad7436bd60c1 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -402,12 +402,12 @@ void disk_uevent(struct gendisk *disk, enum kobject_action action)
xa_for_each(&disk->part_tbl, idx, part) {
if (bdev_is_partition(part) && !bdev_nr_sectors(part))
continue;
- if (!bdgrab(part))
+ if (!kobject_get_unless_zero(&part->bd_device.kobj))
continue;
rcu_read_unlock();
kobject_uevent(bdev_kobj(part), action);
- bdput(part);
+ put_device(&part->bd_device);
rcu_read_lock();
}
rcu_read_unlock();