Skip to content

Commit 595d7eb

Browse files
joannekoongtorvalds
authored andcommitted
fuse: remove page alignment check for writeback len
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 lengths 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 <[email protected]> Fixes: ef7e7cb ("fuse: use iomap for writeback") Reported-by: Linux Kernel Functional Testing <[email protected]> Link: https://lore.kernel.org/linux-fsdevel/CA+G9fYs5AdVM-T2Tf3LciNCwLZEHetcnSkHsjZajVwwpM2HmJw@mail.gmail.com/ Reported-by: Sasha Levin <[email protected]> Reviewed-by: Darrick J. Wong <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent b5d760d commit 595d7eb

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

fs/fuse/file.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2154,8 +2154,6 @@ static ssize_t fuse_iomap_writeback_range(struct iomap_writepage_ctx *wpc,
21542154
loff_t offset = offset_in_folio(folio, pos);
21552155

21562156
WARN_ON_ONCE(!data);
2157-
/* len will always be page aligned */
2158-
WARN_ON_ONCE(len & (PAGE_SIZE - 1));
21592157

21602158
if (!data->ff) {
21612159
data->ff = fuse_write_file_get(fi);

0 commit comments

Comments
 (0)