Skip to content

Commit 10c70d9

Browse files
Christoph Hellwigaxboe
authored andcommitted
block: remove the bd_openers checks in blk_drop_partitions
When replacing the bd_super check with a bd_openers I followed a logical conclusion, which turns out to be utterly wrong. When a block device has bd_super sets it has a mount file system on it (although not every mounted file system sets bd_super), but that also implies it doesn't even have partitions to start with. So instead of trying to come up with a logical check for all openers, just remove the check entirely. Fixes: d3ef553 ("block: fix busy device checking in blk_drop_partitions") Fixes: cb6b771 ("block: fix busy device checking in blk_drop_partitions again") Reported-by: Michal Koutný <[email protected]> Reported-by: Yang Xu <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent 47ed39e commit 10c70d9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

block/partitions/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ int blk_drop_partitions(struct gendisk *disk, struct block_device *bdev)
496496

497497
if (!disk_part_scan_enabled(disk))
498498
return 0;
499-
if (bdev->bd_part_count || bdev->bd_openers > 1)
499+
if (bdev->bd_part_count)
500500
return -EBUSY;
501501
res = invalidate_partition(disk, 0);
502502
if (res)

0 commit comments

Comments
 (0)