Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

block: unhash the inode earlier in delete_partition

Move the call to remove_inode_hash to the beginning of delete_partition,
as we want to prevent opening a block_device that is about to be removed
ASAP.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Jan Kara <jack@suse.cz>
Acked-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Link: https://lore.kernel.org/r/20230601094459.1350643-7-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Christoph Hellwig and committed by
Jens Axboe
69f90b70 a4f75764

+6 -6
+6 -6
block/partitions/core.c
··· 267 267 { 268 268 lockdep_assert_held(&part->bd_disk->open_mutex); 269 269 270 + /* 271 + * Remove the block device from the inode hash, so that it cannot be 272 + * looked up any more even when openers still hold references. 273 + */ 274 + remove_inode_hash(part->bd_inode); 275 + 270 276 fsync_bdev(part); 271 277 __invalidate_device(part, true); 272 278 273 279 xa_erase(&part->bd_disk->part_tbl, part->bd_partno); 274 280 kobject_put(part->bd_holder_dir); 275 281 device_del(&part->bd_device); 276 - 277 - /* 278 - * Remove the block device from the inode hash, so that it cannot be 279 - * looked up any more even when openers still hold references. 280 - */ 281 - remove_inode_hash(part->bd_inode); 282 282 283 283 put_device(&part->bd_device); 284 284 }