* [PATCH] block: don't add partitions if GD_SUPPRESS_PART_SCAN is set
@ 2022-08-23 10:38 Ming Lei
2022-08-23 16:35 ` Christoph Hellwig
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Ming Lei @ 2022-08-23 10:38 UTC (permalink / raw)
To: Jens Axboe; +Cc: linux-block, Christoph Hellwig, Ming Lei
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 <ming.lei@redhat.com>
---
block/partitions/core.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/block/partitions/core.c b/block/partitions/core.c
index fc1d70384825..b8112f52d388 100644
--- a/block/partitions/core.c
+++ b/block/partitions/core.c
@@ -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;
--
2.31.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] block: don't add partitions if GD_SUPPRESS_PART_SCAN is set
2022-08-23 10:38 [PATCH] block: don't add partitions if GD_SUPPRESS_PART_SCAN is set Ming Lei
@ 2022-08-23 16:35 ` Christoph Hellwig
2022-09-03 9:38 ` Ming Lei
2022-09-03 17:29 ` Jens Axboe
2 siblings, 0 replies; 4+ messages in thread
From: Christoph Hellwig @ 2022-08-23 16:35 UTC (permalink / raw)
To: Ming Lei; +Cc: Jens Axboe, linux-block, Christoph Hellwig
On Tue, Aug 23, 2022 at 06:38:19PM +0800, Ming Lei wrote:
> 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 <ming.lei@redhat.com>
Looks good:
Reviewed-by: Christoph Hellwig <hch@lst.de>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] block: don't add partitions if GD_SUPPRESS_PART_SCAN is set
2022-08-23 10:38 [PATCH] block: don't add partitions if GD_SUPPRESS_PART_SCAN is set Ming Lei
2022-08-23 16:35 ` Christoph Hellwig
@ 2022-09-03 9:38 ` Ming Lei
2022-09-03 17:29 ` Jens Axboe
2 siblings, 0 replies; 4+ messages in thread
From: Ming Lei @ 2022-09-03 9:38 UTC (permalink / raw)
To: Jens Axboe; +Cc: linux-block, Christoph Hellwig
On Tue, Aug 23, 2022 at 06:38:19PM +0800, Ming Lei wrote:
> 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 <ming.lei@redhat.com>
Hello Jens,
Any chance to merge this patch to v6.0?
Thanks,
Ming
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] block: don't add partitions if GD_SUPPRESS_PART_SCAN is set
2022-08-23 10:38 [PATCH] block: don't add partitions if GD_SUPPRESS_PART_SCAN is set Ming Lei
2022-08-23 16:35 ` Christoph Hellwig
2022-09-03 9:38 ` Ming Lei
@ 2022-09-03 17:29 ` Jens Axboe
2 siblings, 0 replies; 4+ messages in thread
From: Jens Axboe @ 2022-09-03 17:29 UTC (permalink / raw)
To: Ming Lei; +Cc: linux-block, Christoph Hellwig
On Tue, 23 Aug 2022 18:38:19 +0800, Ming Lei wrote:
> 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.
>
> [...]
Applied, thanks!
[1/1] block: don't add partitions if GD_SUPPRESS_PART_SCAN is set
commit: 748008e1da926a814cc0a054c81ca614408b1b0c
Best regards,
--
Jens Axboe
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-09-03 17:29 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-23 10:38 [PATCH] block: don't add partitions if GD_SUPPRESS_PART_SCAN is set Ming Lei
2022-08-23 16:35 ` Christoph Hellwig
2022-09-03 9:38 ` Ming Lei
2022-09-03 17:29 ` Jens Axboe
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.