linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: alexjlzheng@gmail.com
Cc: brauner@kernel.org, djwong@kernel.org, linux-xfs@vger.kernel.org,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	Jinliang Zheng <alexjlzheng@tencent.com>
Subject: Re: [PATCH v2 1/4] iomap: make sure iomap_adjust_read_range() are aligned with block_size
Date: Mon, 11 Aug 2025 03:39:02 -0700	[thread overview]
Message-ID: <aJnIRs-XbL34EmGo@infradead.org> (raw)
In-Reply-To: <20250810101554.257060-2-alexjlzheng@tencent.com>

On Sun, Aug 10, 2025 at 06:15:51PM +0800, alexjlzheng@gmail.com wrote:
> From: Jinliang Zheng <alexjlzheng@tencent.com>
> 
> iomap_folio_state marks the uptodate state in units of block_size, so
> it is better to check that pos and length are aligned with block_size.
> 
> Signed-off-by: Jinliang Zheng <alexjlzheng@tencent.com>
> ---
>  fs/iomap/buffered-io.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c
> index fd827398afd2..934458850ddb 100644
> --- a/fs/iomap/buffered-io.c
> +++ b/fs/iomap/buffered-io.c
> @@ -234,6 +234,9 @@ static void iomap_adjust_read_range(struct inode *inode, struct folio *folio,
>  	unsigned first = poff >> block_bits;
>  	unsigned last = (poff + plen - 1) >> block_bits;
>  
> +	BUG_ON(*pos & (block_size - 1));
> +	BUG_ON(length & (block_size - 1));

We should not add BUG_ON calls like this, please turn these into
WARN_ON_ONCE instead.


  reply	other threads:[~2025-08-11 10:39 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-10 10:15 [PATCH v2 0/4] iomap: allow partial folio write with iomap_folio_state alexjlzheng
2025-08-10 10:15 ` [PATCH v2 1/4] iomap: make sure iomap_adjust_read_range() are aligned with block_size alexjlzheng
2025-08-11 10:39   ` Christoph Hellwig [this message]
2025-08-12  7:24   ` Geert Uytterhoeven
2025-08-10 10:15 ` [PATCH v2 2/4] iomap: move iter revert case out of the unwritten branch alexjlzheng
2025-08-11 10:40   ` Christoph Hellwig
2025-08-10 10:15 ` [PATCH v2 3/4] iomap: make iomap_write_end() return the number of written length again alexjlzheng
2025-08-10 10:15 ` [PATCH v2 4/4] iomap: don't abandon the whole thing with iomap_folio_state alexjlzheng
2025-08-11 10:41   ` Christoph Hellwig
2025-08-11 12:18     ` Jinliang Zheng
2025-08-11 10:38 ` [PATCH v2 0/4] iomap: allow partial folio write " Christoph Hellwig
2025-08-11 12:08   ` Jinliang Zheng

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=aJnIRs-XbL34EmGo@infradead.org \
    --to=hch@infradead.org \
    --cc=alexjlzheng@gmail.com \
    --cc=alexjlzheng@tencent.com \
    --cc=brauner@kernel.org \
    --cc=djwong@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-xfs@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;
as well as URLs for NNTP newsgroup(s).