]> Git Repo - linux.git/commitdiff
block: don't add partitions if GD_SUPPRESS_PART_SCAN is set
authorMing Lei <[email protected]>
Tue, 23 Aug 2022 10:38:19 +0000 (18:38 +0800)
committerJens Axboe <[email protected]>
Sat, 3 Sep 2022 17:29:03 +0000 (11:29 -0600)
Commit b9684a71fca7 ("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: b9684a71fca7 ("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]>
block/partitions/core.c

index fc1d70384825cd804cce322038694126dbcbc4b8..b8112f52d38800742a2e51eb4af61fa116da35d6 100644 (file)
@@ -596,6 +596,9 @@ static int blk_add_partitions(struct gendisk *disk)
        if (disk->flags & GENHD_FL_NO_PART)
                return 0;
 
+       if (test_bit(GD_SUPPRESS_PART_SCAN, &disk->state))
+               return 0;
+
        state = check_partition(disk);
        if (!state)
                return 0;
This page took 0.057661 seconds and 4 git commands to generate.