From: Keith Busch <kbusch@kernel.org>
To: Maks <mi9992828@gmail.com>
Cc: linux-block@vger.kernel.org, Jens Axboe <axboe@kernel.dk>
Subject: Re: block: zero logical block size leads to infinite loop in set_init_blocksize()
Date: Wed, 9 Sep 2026 13:51:43 -0600 [thread overview]
Message-ID: <aqG4zwW0r8jGuBPE@kbusch-mbp> (raw)
In-Reply-To: <20260909191107.53134-1-mi9992828@gmail.com>
On Wed, Sep 09, 2026 at 10:11:07PM +0300, Maks wrote:
> Hi,
>
> > How did you manage to get a block_device created, but bypassed the check
> > and override for a zero logical block size in blk_validate_limits()? Is
> > your driver writing over the limits outside the API's update path?
>
> Yes, it does update the queue limits directly:
>
> volume->queue->limits = limits;
>
> There is no blk_validate_limits() call on this path, so this bypasses the
> normal queue limits validation.
>
> Given that the driver is clearly bypassing the normal queue limits
> validation, would a defensive check in set_init_blocksize() still be
> considered worthwhile to avoid the infinite loop in this case?
There's just a lot more places than set_init_blocksize() that assumes
bdev_logical_block_size() returns a validated value. If you've a driver
bypassing the API's that manage this field, then there's many other
functions that also won't work correctly.
prev parent reply other threads:[~2026-09-09 19:51 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-03 17:41 block: zero logical block size leads to infinite loop in set_init_blocksize() Maks
2026-09-03 17:55 ` Keith Busch
2026-09-03 18:50 ` Maksim Ivanov
2026-09-09 19:11 ` Maks
2026-09-09 19:51 ` Keith Busch [this message]
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=aqG4zwW0r8jGuBPE@kbusch-mbp \
--to=kbusch@kernel.org \
--cc=axboe@kernel.dk \
--cc=linux-block@vger.kernel.org \
--cc=mi9992828@gmail.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.