summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2021-07-22 09:53:55 +0200
committerJens Axboe <axboe@kernel.dk>2021-08-02 13:37:28 -0600
commita45e43cad798173b41e0d6f119784826d3ead02c (patch)
tree6cfc06d96cdebf17f0beeea5aa3a4539afcec8d4
parent503469b5b30f76169c6302d1469e69a2fb67faf9 (diff)
downloadlinux-stable-a45e43cad798173b41e0d6f119784826d3ead02c.tar.gz
linux-stable-a45e43cad798173b41e0d6f119784826d3ead02c.tar.bz2
linux-stable-a45e43cad798173b41e0d6f119784826d3ead02c.zip
block: assert the locking state in delete_partition
Add a lockdep assert instead of the outdated locking comment. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Josef Bacik <josef@toxicpanda.com> Reviewed-by: Ming Lei <ming.lei@redhat.com> Reviewed-by: Chaitanya Kulkarni <ckulkarnilinux@gmail.com> Link: https://lore.kernel.org/r/20210722075402.983367-3-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--block/partitions/core.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/block/partitions/core.c b/block/partitions/core.c
index 4230d4f71879..9902b1635b7d 100644
--- a/block/partitions/core.c
+++ b/block/partitions/core.c
@@ -281,12 +281,10 @@ struct device_type part_type = {
.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)
{
+ lockdep_assert_held(&part->bd_disk->open_mutex);
+
fsync_bdev(part);
__invalidate_device(part, true);