Skip to content

Commit 44cb781

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 <marco.nelissen@gmail.com>
1 parent a7a21ad commit 44cb781

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
@@ -3004,7 +3004,7 @@ static inline loff_t folio_seek_hole_data(struct xa_state *xas,
30043004
if (ops->is_partially_uptodate(folio, offset, bsz) ==
30053005
seek_data)
30063006
break;
3007-
start = (start + bsz) & ~(bsz - 1);
3007+
start = (start + bsz) & ~((u64)bsz - 1);
30083008
offset += bsz;
30093009
} while (offset < folio_size(folio));
30103010
unlock:

0 commit comments

Comments
 (0)