Re: [PATCH v3] fscache, cachefiles: Fix resize handling
From: Christian Brauner
Date: Fri Oct 16 2026 - 05:08:42 EST
On Thu, 08 Oct 2026 19:16:34 +0100, David Howells wrote:
> Fix the resize handling in fscache and cachefiles by passing down a flag to
> indicate if the file is being shrunk as the cache's idea of how big the
> file should be may be stale and thus not useful in comparison to the
> object's size.
>
> The issue is that netfs_perform_write() updates the network filesystem's
> file's i_size as it adds data to the pagecache, but the cache isn't updated
> until writeback flushes that data. A truncation may then scrap that data
> and so the cache never sees it and doesn't update before it is told to
> resize. In the resize, cachefiles was comparing the new size against the
> current cache size and then thinking the file was being expanded.
>
> [...]
Applied to the vfs-7.4.netfs branch of the vfs/vfs.git tree.
Patches in the vfs-7.4.netfs branch should appear in linux-next soon.
Please report any outstanding bugs that were missed during review in a
new review to the original patch series allowing us to drop it.
It's encouraged to provide Acked-bys and Reviewed-bys even though the
patch has now been applied. If possible patch trailers will be updated.
Note that commit hashes shown below are subject to change due to rebase,
trailer updates or similar. If in doubt, please check the listed branch.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
branch: vfs-7.4.netfs
[1/1] fscache, cachefiles: Fix resize handling
https://git.kernel.org/vfs/vfs/c/f65f6269cd37