[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230812021550.GB971@sol.localdomain>
Date: Fri, 11 Aug 2023 19:15:50 -0700
From: Eric Biggers <ebiggers@...nel.org>
To: Gabriel Krisman Bertazi <krisman@...e.de>
Cc: viro@...iv.linux.org.uk, brauner@...nel.org, tytso@....edu,
jaegeuk@...nel.org, linux-fsdevel@...r.kernel.org,
linux-ext4@...r.kernel.org, linux-f2fs-devel@...ts.sourceforge.net,
Gabriel Krisman Bertazi <krisman@...labora.com>
Subject: Re: [PATCH v5 04/10] fs: Expose name under lookup to d_revalidate
hooks
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
Powered by blists - more mailing lists