On Fri, Aug 11, 2023 at 08:41:40PM -0400, Gabriel Krisman Bertazi wrote: > diff --git a/Documentation/filesystems/vfs.rst b/Documentation/filesystems/vfs.rst > index cb2a97e49872..ddd542c2a722 100644 > --- a/Documentation/filesystems/vfs.rst > +++ b/Documentation/filesystems/vfs.rst > @@ -1251,7 +1251,8 @@ defined: > .. code-block:: c > > struct dentry_operations { > - int (*d_revalidate)(struct dentry *, unsigned int); > + int (*d_revalidate)(struct dentry *, const struct qstr *, > + unsigned int); > int (*d_weak_revalidate)(struct dentry *, unsigned int); > int (*d_hash)(const struct dentry *, struct qstr *); > int (*d_compare)(const struct dentry *, > @@ -1284,6 +1285,14 @@ defined: > they can change and, in d_inode case, even become NULL under > us). > > + Filesystems shouldn't rely on the name under lookup, unless > + there are particular filename encoding semantics to be handled > + during revalidation. Note the name under lookup can change from > + under d_revalidate, so it must be protected with ->d_lock before > + accessing. The exception is when revalidating negative dentries > + for creation, in which case the parent inode prevents it from > + changing. Actually, the "name under lookup" can never change. It's passed as the 'name' argument, newly added by this patch. What this paragraph is actually about is the ->d_name of the dentry being revalidated. The documentation should make it clear when it means ->d_name and when it means name, how they differ from each other, and what the purpose of each is. - Eric