Re: [RFC PATCH 17/17] netfs: Combine prepare and issue ops and grab the buffers on request

Christoph Hellwig
2026-03-04T14:39:37Z

On Wed, Mar 04, 2026 at 02:03:24PM +0000, David Howells wrote:
> +/*
> + * Query the occupancy of the cache in a region, returning the extent of the
> + * next chunk of cached data and the next hole.
> + */
> +static int cachefiles_query_occupancy(struct netfs_cache_resources *cres,
> + struct fscache_occupancy *occ)
> +{

Independent of fiemap or not, how is this supposed to work? File
systems can create speculative preallocations any time they want,
so simply querying for holes vs data will corrupt your cache trivially.