On Tue, Feb 11, 2025 at 12:08:21AM +0000, Viacheslav Dubeyko wrote: > In general, the MDS can issue NULL dentries to clients so that they "know" the > direntry does not exist without having some capability (or lease) associated > with it. As far as I can see, if application repeatedly does stat of file, then > the kernel driver isn't repeatedly going out to the MDS to lookup that file. So, > I assume that this is the goal of this check and logic. Er... On repeated stat(2) you will get ->lookup() called the first time around; afterwards you'll be getting dentry from dcache lookup. With ->d_revalidate() each time you find it in dcache, and eviction if ->d_revalidate() says it's stale. In which case a new dentry will be allocated and fed to ->lookup(), passed to it in negative-unhashed state...