mirror of
https://github.com/torvalds/linux.git
synced 2025-11-02 09:40:27 +02:00
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.
Link: https://lkml.kernel.org/r/20250102190540.1356838-1-marco.nelissen@gmail.com
Fixes: 54fa39ac2e ("iomap: use mapping_seek_hole_data")
Signed-off-by: Marco Nelissen <marco.nelissen@gmail.com>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
parent
4bbb6df62c
commit
f505e6c91e
1 changed files with 1 additions and 1 deletions
|
|
@ -2996,7 +2996,7 @@ static inline loff_t folio_seek_hole_data(struct xa_state *xas,
|
|||
if (ops->is_partially_uptodate(folio, offset, bsz) ==
|
||||
seek_data)
|
||||
break;
|
||||
start = (start + bsz) & ~(bsz - 1);
|
||||
start = (start + bsz) & ~((u64)bsz - 1);
|
||||
offset += bsz;
|
||||
} while (offset < folio_size(folio));
|
||||
unlock:
|
||||
|
|
|
|||
Loading…
Reference in a new issue