Skip to content

Commit 57957c8

Browse files
marconepelwell
authored andcommitted
iomap: avoid avoid truncating 64-bit offset to 32 bits
commit c13094b upstream. on 32-bit kernels, iomap_write_delalloc_scan() was inadvertently using a 32-bit position due to folio_next_index() returning an unsigned long. This could lead to an infinite loop when writing to an xfs filesystem. Signed-off-by: Marco Nelissen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Darrick J. Wong <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Signed-off-by: Christian Brauner <[email protected]>
1 parent e30a581 commit 57957c8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/iomap/buffered-io.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1138,7 +1138,7 @@ static void iomap_write_delalloc_scan(struct inode *inode,
11381138
start_byte, end_byte, iomap, punch);
11391139

11401140
/* move offset to start of next folio in range */
1141-
start_byte = folio_next_index(folio) << PAGE_SHIFT;
1141+
start_byte = folio_pos(folio) + folio_size(folio);
11421142
folio_unlock(folio);
11431143
folio_put(folio);
11441144
}

0 commit comments

Comments
 (0)