From: "Arnd Bergmann" <arnd@arndb.de>
To: "Hungyu Lin" <dennylin0707@gmail.com>, "Jens Axboe" <axboe@kernel.dk>
Cc: ben.hutchings@codethink.co.uk, linux-block@vger.kernel.org,
linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH] block: Return the soft block size for compat BLKBSZGET
Date: Fri, 23 Oct 2026 18:27:07 +0200 [thread overview]
Message-ID: <0241d3be-82d3-4ad0-a055-3897e7dfc475@app.fastmail.com> (raw)
In-Reply-To: <20261023153645.37546-1-dennylin0707@gmail.com>
On Fri, Oct 23, 2026, at 17:36, Hungyu Lin wrote:
> BLKBSZGET returns the block device's soft block size, while BLKSSZGET
> returns its logical sector size. The compat BLKBSZGET_32 handler uses
> bdev_logical_block_size(), so it returns the wrong value when these
> sizes differ.
>
> For example, on an x86_64 kernel a native query of a RAM or loop device
> with 512-byte logical sectors returns the initial soft block size of
> 4096 bytes, but an i386 process gets 512 bytes. This makes 32-bit
> blockdev --getbsz and the BSZ column of --report disagree with native
> queries, even without a preceding BLKBSZSET.
>
> Use block_size() as the native handler and the pre-regression compat
> handler do, and correct the case comment to describe the soft size.
>
> Fixes: 9b81648cb5e3 ("compat_ioctl: simplify up block/ioctl.c")
> Cc: stable@vger.kernel.org
> Signed-off-by: Hungyu Lin <dennylin0707@gmail.com>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
prev parent reply other threads:[~2026-10-23 16:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-23 15:36 Hungyu Lin
2026-10-23 16:27 ` Arnd Bergmann [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=0241d3be-82d3-4ad0-a055-3897e7dfc475@app.fastmail.com \
--to=arnd@arndb.de \
--cc=axboe@kernel.dk \
--cc=ben.hutchings@codethink.co.uk \
--cc=dennylin0707@gmail.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@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
all inboxes | Powered by JetHome®