linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joanne Koong <joannelkoong@gmail.com>
To: brauner@kernel.org
Cc: djwong@kernel.org, linux-fsdevel@vger.kernel.org,
	miklos@szeredi.hu, naresh.kamboju@linaro.org,
	Linux Kernel Functional Testing <lkft@linaro.org>
Subject: [PATCH] fuse: remove page alignment check for writeback len
Date: Wed, 23 Jul 2025 16:08:50 -0700	[thread overview]
Message-ID: <20250723230850.2395561-1-joannelkoong@gmail.com> (raw)

Remove incorrect page alignment check for the writeback len arg in
fuse_iomap_writeback_range(). len will always be block-aligned as passed
in by iomap. On regular fuse filesystems, i_blkbits is set to PAGE_SHIFT
so this is not a problem but for fuseblk filesystems, the block size is
set to a default of 512 bytes or a block size passed in at mount time.

Please note that non-page-aligned lens are fine for the logic in
fuse_iomap_writeback_range(). The check was originally added as a
safeguard to detect conspicuously wrong ranges.

Signed-off-by: Joanne Koong <joannelkoong@gmail.com>
Fixes: ef7e7cbb323f ("fuse: use iomap for writeback")
Reported-by: Linux Kernel Functional Testing <lkft@linaro.org>

[1] report:
https://lore.kernel.org/linux-fsdevel/CA+G9fYs5AdVM-T2Tf3LciNCwLZEHetcnSkHsjZajVwwpM2HmJw@mail.gmail.com/
---
 fs/fuse/file.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index f16426fd2bf5..883dc94a0ce0 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -2155,8 +2155,6 @@ static ssize_t fuse_iomap_writeback_range(struct iomap_writepage_ctx *wpc,
 	loff_t offset = offset_in_folio(folio, pos);
 
 	WARN_ON_ONCE(!data);
-	/* len will always be page aligned */
-	WARN_ON_ONCE(len & (PAGE_SIZE - 1));
 
 	if (!data->ff) {
 		data->ff = fuse_write_file_get(fi);
-- 
2.47.3


             reply	other threads:[~2025-07-23 23:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-23 23:08 Joanne Koong [this message]
2025-07-24 16:25 ` [PATCH] fuse: remove page alignment check for writeback len Darrick J. Wong
2025-07-24 19:03   ` Naresh Kamboju

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=20250723230850.2395561-1-joannelkoong@gmail.com \
    --to=joannelkoong@gmail.com \
    --cc=brauner@kernel.org \
    --cc=djwong@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=lkft@linaro.org \
    --cc=miklos@szeredi.hu \
    --cc=naresh.kamboju@linaro.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).