All of lore.kernel.org
 help / color / mirror / Atom feed
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: Thu, 3 Sep 2026 11:55:55 -0600	[thread overview]
Message-ID: <apm0q8sNDooT53jU@kbusch-mbp> (raw)
In-Reply-To: <20260903174124.51009-1-mi9992828@gmail.com>

On Thu, Sep 03, 2026 at 08:41:24PM +0300, Maks wrote:
> Hi,
> 
> I hit a soft lockup in set_init_blocksize() with a block device whose
> logical_block_size was zero.
> 
> I understand that logical_block_size == 0 violates the block layer
> contract and that the driver which allowed this value needs to be fixed.
> 
> However, the generic block code currently turns this invariant violation
> into a non-terminating loop:
> 
> while (bsize < PAGE_SIZE) {
>     if (size & bsize)
>         break;
>     bsize <<= 1;
> }
> 
> With bsize == 0, the value never changes.

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?

  reply	other threads:[~2026-09-03 17:55 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 [this message]
2026-09-03 18:50   ` Maksim Ivanov
2026-09-09 19:11   ` Maks
2026-09-09 19:51     ` Keith Busch

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=apm0q8sNDooT53jU@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.