Re: fscache: Redesigning the on-disk cache

From: J. Bruce Fields
Date: Mon Mar 08 2021 - 13:55:17 EST


On Mon, Mar 08, 2021 at 09:13:55AM +0000, David Howells wrote:
> Amir Goldstein <amir73il@xxxxxxxxx> wrote:
> > With ->fiemap() you can at least make the distinction between a non existing
> > and an UNWRITTEN extent.
>
> I can't use that for XFS, Ext4 or btrfs, I suspect. Christoph and Dave's
> assertion is that the cache can't rely on the backing filesystem's metadata
> because these can arbitrarily insert or remove blocks of zeros to bridge or
> split extents.

Could you instead make some sort of explicit contract with the
filesystem? Maybe you'd flag it at mkfs time and query for it before
allowing a filesystem to be used for fscache. You don't need every
filesystem to support fscache, right, just one acceptable one?

--b.