From: Ming Lei <ming.lei@redhat.com>
To: Jens Axboe <axboe@kernel.dk>
Cc: "linux-block@vger.kernel.org" <linux-block@vger.kernel.org>
Subject: Re: ublk invert part scan bit logic
Date: Thu, 12 Feb 2026 20:42:12 +0800 [thread overview]
Message-ID: <aY3KpLbAOchXxXyi@fedora> (raw)
In-Reply-To: <0535f4dd-ada3-414a-84c6-7abc232aa670@kernel.dk>
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.
Thanks
Ming
next prev parent reply other threads:[~2026-02-12 12:42 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 [this message]
2026-02-12 12:48 ` Jens Axboe
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=aY3KpLbAOchXxXyi@fedora \
--to=ming.lei@redhat.com \
--cc=axboe@kernel.dk \
--cc=linux-block@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox