All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Ming Lei <ming.lei@redhat.com>
Cc: "linux-block@vger.kernel.org" <linux-block@vger.kernel.org>
Subject: Re: ublk invert part scan bit logic
Date: Thu, 12 Feb 2026 05:48:40 -0700	[thread overview]
Message-ID: <dfc5a8d3-45d3-4fe2-aa0b-b9571b5fb883@kernel.dk> (raw)
In-Reply-To: <aY3KpLbAOchXxXyi@fedora>

On 2/12/26 5:42 AM, Ming Lei wrote:
> On Thu, Feb 12, 2026 at 04:05:27AM -0700, Jens Axboe wrote:
>> Hi,
>>
>> For ublk, there's this logic in in ublk_ctrl_start_dev():
>>
>> /* Skip partition scan if disabled by user */
>> if (ub->dev_info.flags & UBLK_F_NO_AUTO_PART_SCAN) {
>> 	clear_bit(GD_SUPPRESS_PART_SCAN, &disk->state);
>> } else {
>> 	/* Schedule async partition scan for trusted daemons */
>> 	if (!ub->unprivileged_daemons)
>> 		schedule_work(&ub->partition_scan_work);
>> }
>>
>> where the
>>
>> clear_bit(GD_SUPPRESS_PART_SCAN, &disk->state);
>>
>> seems reversed? Why is GD_SUPPRESS_PART_SCAN being cleared if
>> UBLK_F_NO_AUTO_PART_SCAN is set? Added in:
>>
>> 8443e2087e70 ("ublk: add UBLK_F_NO_AUTO_PART_SCAN feature flag")
> 
> Yeah, the interface is designed in this way: partition scan is not
> done during add disk, and allowed since then on. The selftest code
> is written in same way too.
> 
> If GD_SUPPRESS_PART_SCAN isn't cleared, userspace can't probe partitions
> any more.
> 
> However, if you think the interface isn't good, we still can change it
> before 7.0 release.

What I mean is, if UBLK_F_NO_AUTO_PART_SCAN is set, should we not
either leave the disk->state alone, or _set_ GD_SUPPRESS_PART_SCAN?
I might be confused here, but the current implementation doesn't
make much sense to me! If it is correct, then a comment to that
effect would be good imho.

-- 
Jens Axboe


  reply	other threads:[~2026-02-12 12:48 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-12 11:05 ublk invert part scan bit logic Jens Axboe
2026-02-12 12:42 ` Ming Lei
2026-02-12 12:48   ` Jens Axboe [this message]
2026-02-12 13:02     ` Ming Lei
2026-02-12 14:04       ` Hannes Reinecke
2026-02-12 14:22         ` Ming Lei
2026-02-12 15:06           ` Hannes Reinecke
2026-02-12 18:26           ` Alexander Atanasov
2026-02-12 13:08 ` Alexander Atanasov
2026-02-12 13:17   ` Ming Lei
2026-02-12 18:03     ` Alexander Atanasov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=dfc5a8d3-45d3-4fe2-aa0b-b9571b5fb883@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=linux-block@vger.kernel.org \
    --cc=ming.lei@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.