Skip to content

Commit 748008e

Browse files
Ming Leiaxboe
authored andcommitted
block: don't add partitions if GD_SUPPRESS_PART_SCAN is set
Commit b9684a7 ("block, loop: support partitions without scanning") adds GD_SUPPRESS_PART_SCAN for replacing part function of GENHD_FL_NO_PART. But looks blk_add_partitions() is missed, since loop doesn't want to add partitions if GENHD_FL_NO_PART was set. And it causes regression on libblockdev (as called from udisks) which operates with the LO_FLAGS_PARTSCAN. Fixes the issue by not adding partitions if GD_SUPPRESS_PART_SCAN is set. Fixes: b9684a7 ("block, loop: support partitions without scanning") Signed-off-by: Ming Lei <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent 7a3d222 commit 748008e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

block/partitions/core.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -596,6 +596,9 @@ static int blk_add_partitions(struct gendisk *disk)
596596
if (disk->flags & GENHD_FL_NO_PART)
597597
return 0;
598598

599+
if (test_bit(GD_SUPPRESS_PART_SCAN, &disk->state))
600+
return 0;
601+
599602
state = check_partition(disk);
600603
if (!state)
601604
return 0;

0 commit comments

Comments
 (0)