Commit a45e43ca authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe

block: assert the locking state in delete_partition

Add a lockdep assert instead of the outdated locking comment.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarJosef Bacik <josef@toxicpanda.com>
Reviewed-by: default avatarMing Lei <ming.lei@redhat.com>
Reviewed-by: default avatarChaitanya Kulkarni <ckulkarnilinux@gmail.com>
Link: https://lore.kernel.org/r/20210722075402.983367-3-hch@lst.deSigned-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 503469b5
...@@ -281,12 +281,10 @@ struct device_type part_type = { ...@@ -281,12 +281,10 @@ struct device_type part_type = {
.uevent = part_uevent, .uevent = part_uevent,
}; };
/*
* Must be called either with open_mutex held, before a disk can be opened or
* after all disk users are gone.
*/
static void delete_partition(struct block_device *part) static void delete_partition(struct block_device *part)
{ {
lockdep_assert_held(&part->bd_disk->open_mutex);
fsync_bdev(part); fsync_bdev(part);
__invalidate_device(part, true); __invalidate_device(part, true);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment