linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: Christoph Hellwig <hch@infradead.org>
Cc: Qu Wenruo <wqu@suse.com>,
	linux-btrfs@vger.kernel.org, brauner@kernel.org,
	djwong@kernel.org, linux-xfs@vger.kernel.org,
	linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH RFC] iomap: ensure iomap_dio_bio_iter() only submit bios that are fs block aligned
Date: Tue, 7 Oct 2025 05:19:42 +0100	[thread overview]
Message-ID: <aOSU3h7tTLz-qDeE@casper.infradead.org> (raw)
In-Reply-To: <aOSRe1wDI5JD_wvc@infradead.org>

On Mon, Oct 06, 2025 at 09:05:15PM -0700, Christoph Hellwig wrote:
> On Tue, Oct 07, 2025 at 04:52:09AM +0100, Matthew Wilcox wrote:
> > On Tue, Oct 07, 2025 at 01:40:22PM +1030, Qu Wenruo wrote:
> > > During my development of btrfs bs > ps support, I hit some read bios
> > > that are submitted from iomap to btrfs, but are not aligned to fs block
> > > size.
> > > 
> > > In my case the fs block size is 8K, the page size is 4K. The ASSERT()
> > > looks like this:
> > 
> > Why isn't bdev_logical_block_size() set correctly by btrfs?
> 
> bdev_logical_block_size is never set by the file system.  It is the LBA
> size of the underlying block device.  But if the file system block size
> is larger AND the file system needs to do file system block size
> granularity operations that is not the correct boundary.  See also the
> iov_iter_alignment for always COW / zoned file system in
> xfs_file_dio_write.

But the case he's complaining about is bs>PS, so the LBA size really is
larger than PAGE_SIZE.

  reply	other threads:[~2025-10-07  4:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-07  3:10 [PATCH RFC] iomap: ensure iomap_dio_bio_iter() only submit bios that are fs block aligned Qu Wenruo
2025-10-07  3:52 ` Matthew Wilcox
2025-10-07  4:05   ` Christoph Hellwig
2025-10-07  4:19     ` Matthew Wilcox [this message]
2025-10-07  4:24       ` Christoph Hellwig
2025-10-07  4:26       ` Qu Wenruo
2025-10-07  4:10 ` Christoph Hellwig
2025-10-07  4:29   ` Qu Wenruo

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=aOSU3h7tTLz-qDeE@casper.infradead.org \
    --to=willy@infradead.org \
    --cc=brauner@kernel.org \
    --cc=djwong@kernel.org \
    --cc=hch@infradead.org \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=wqu@suse.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).