]> git.ipfire.org Git - thirdparty/linux.git/commit
ntfs: drop stale page-cache when shrinking a non-resident attr
authorNamjae Jeon <linkinjeon@kernel.org>
Mon, 13 Jul 2026 07:49:57 +0000 (16:49 +0900)
committerNamjae Jeon <linkinjeon@kernel.org>
Tue, 21 Jul 2026 09:48:24 +0000 (18:48 +0900)
commit4e646ecd44759e552b0b9ccd995f3f608daab414
treef1cbe99f34ef5aed50e592b93d452a7ab6cff7db
parent8bed376124ab4505b70083a2b91f2c7ef6d51e24
ntfs: drop stale page-cache when shrinking a non-resident attr

ntfs_non_resident_attr_shrink() shrinks attribute sizes but fails to
trim the page cache. This leaves orphaned dirty folios beyond the new
end of the attribute, leading to writeback failures (-ENOENT), data
loss, and $EA chain corruption.

Fix this by truncating the page cache to the new size immediately after
updating the sizes, preventing writeback from flushing out-of-range folios.

Fixes: 495e90fa3348 ("ntfs: update attrib operations")
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
fs/ntfs/attrib.c