diff options
| author | Chris Mason <mason@kernel.org> | 2026-11-09 18:51:12 -0500 |
|---|---|---|
| committer | Carlos Maiolino <cem@kernel.org> | 2026-11-10 11:22:27 +0100 |
| commit | 8190880c904fd8ddb943d808e04b12174ce660f8 (patch) | |
| tree | 094a2ff1bfb638b6d699c5a8d15aade52879b3a9 /tools/perf/scripts/python/bin | |
| parent | 369726f6be714852f4e73882a351938bd3f8c4cd (diff) | |
xfs: don't skip the flush before shifting extents
On an XFS file larger than 4 EiB, collapse range and insert range can
drop dirty data without writing it back, and then fail with
EFSCORRUPTED.
xfs_prepare_shift() flushes the page cache from its offset to EOF, but
passes i_size as the length. Above 4 EiB the end of that range can
overflow and turn negative. filemap_write_and_wait_range() then writes
nothing, but truncate_pagecache_range() takes the end as unsigned and
drops every folio from the start of the range onward.
A delalloc extent under a dropped folio stays in the data fork, and the
shift returns -EFSCORRUPTED for it.
The fix used here is to pass i_size - offset as the length.
Fixes: 7f9f71be84bc ("xfs: extent shifting doesn't fully invalidate page cache")
Fixes: feeb9b269523 ("filemap: skip write and wait if end offset precedes start")
Signed-off-by: Chris Mason <mason@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/bin')
0 files changed, 0 insertions, 0 deletions
