Re: [PATCH V9 09/11] fs: Introduce DCACHE_DONTCACHE

From: Ira Weiny
Date: Tue Apr 21 2020 - 23:46:12 EST


On Wed, Apr 22, 2020 at 03:34:07AM +0100, Al Viro wrote:
> On Tue, Apr 21, 2020 at 01:25:19PM -0700, Darrick J. Wong wrote:
>
> > > DCACHE_DONTCACHE indicates a dentry should not be cached on final
> > > dput().
> > >
> > > Also add a helper function to mark DCACHE_DONTCACHE on all dentries
> > > pointing to a specific inode when that inode is being set I_DONTCACHE.
> > >
> > > This facilitates dropping dentry references to inodes sooner which
> > > require eviction to swap S_DAX mode.
>
> Explain, please. Questions:
>
> 1) does that ever happen to directories?

Directories never get S_DAX set. So the eviction only needs to happen on
inodes. But that can't happen without dentries also dropping their references.

> 2) how much trouble do we get if such inode is *NOT* evicted for, say, several
> days?

No trouble at all. Users understand that changing the FS_XFLAG_DAX setting
does _not_ immediately result in S_DAX changing.

It is intended that applications requiring a change of mode would flip the
FS_XFLAG_DAX close the file and wait for the eviction (or force it through a
drop cache if they have permission).

Ira