Skip to content

Commit a40c744

Browse files
marconepelwell
authored andcommitted
filemap: avoid truncating 64-bit offset to 32 bits
on 32-bit kernels, folio_seek_hole_data() was inadvertently truncating a 64-bit value to 32 bits, leading to a possible infinite loop when writing to an xfs filesystem. Signed-off-by: Marco Nelissen <[email protected]>
1 parent de92e4b commit a40c744

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mm/filemap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3037,7 +3037,7 @@ static inline loff_t folio_seek_hole_data(struct xa_state *xas,
30373037
if (ops->is_partially_uptodate(folio, offset, bsz) ==
30383038
seek_data)
30393039
break;
3040-
start = (start + bsz) & ~(bsz - 1);
3040+
start = (start + bsz) & ~((u64)bsz - 1);
30413041
offset += bsz;
30423042
} while (offset < folio_size(folio));
30433043
unlock:

0 commit comments

Comments
 (0)