* [PATCH] fuse: remove page alignment check for writeback len
@ 2025-07-23 23:08 Joanne Koong
2025-07-24 16:25 ` Darrick J. Wong
0 siblings, 1 reply; 3+ messages in thread
From: Joanne Koong @ 2025-07-23 23:08 UTC (permalink / raw)
To: brauner
Cc: djwong, linux-fsdevel, miklos, naresh.kamboju,
Linux Kernel Functional Testing
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] fuse: remove page alignment check for writeback len
2025-07-23 23:08 [PATCH] fuse: remove page alignment check for writeback len Joanne Koong
@ 2025-07-24 16:25 ` Darrick J. Wong
2025-07-24 19:03 ` Naresh Kamboju
0 siblings, 1 reply; 3+ messages in thread
From: Darrick J. Wong @ 2025-07-24 16:25 UTC (permalink / raw)
To: Joanne Koong
Cc: brauner, linux-fsdevel, miklos, naresh.kamboju,
Linux Kernel Functional Testing
On Wed, Jul 23, 2025 at 04:08:50PM -0700, Joanne Koong wrote:
> 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>
Seems fine to me,
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
--D
>
> [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
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] fuse: remove page alignment check for writeback len
2025-07-24 16:25 ` Darrick J. Wong
@ 2025-07-24 19:03 ` Naresh Kamboju
0 siblings, 0 replies; 3+ messages in thread
From: Naresh Kamboju @ 2025-07-24 19:03 UTC (permalink / raw)
To: Joanne Koong
Cc: Darrick J. Wong, brauner, linux-fsdevel, miklos,
Linux Kernel Functional Testing
On Thu, 24 Jul 2025 at 21:55, Darrick J. Wong <djwong@kernel.org> wrote:
>
> On Wed, Jul 23, 2025 at 04:08:50PM -0700, Joanne Koong wrote:
> > 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>
I have applied this patch on top of the Linux next tree and performed
testing. The previously reported regressions [1] are no longer observed.
Thank you for providing the fix.
Tested-by: Linux Kernel Functional Testing <lkft@linaro.org>
>
> Seems fine to me,
> Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
>
> --D
>
> >
[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
> >
> >
--
Linaro LKFT
https://lkft.linaro.org
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-07-24 19:03 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-23 23:08 [PATCH] fuse: remove page alignment check for writeback len Joanne Koong
2025-07-24 16:25 ` Darrick J. Wong
2025-07-24 19:03 ` Naresh Kamboju
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).