From: Al Viro <viro@zeniv.linux.org.uk>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: linux-fsdevel@vger.kernel.org,
Linus Torvalds <torvalds@linux-foundation.org>,
Neil Brown <neilb@suse.de>,
Christian Brauner <brauner@kernel.org>, Jan Kara <jack@suse.cz>
Subject: Re: [RFC] dentry->d_flags locking
Date: Tue, 25 Feb 2025 17:56:34 +0000 [thread overview]
Message-ID: <20250225175634.GY1977892@ZenIV> (raw)
In-Reply-To: <CAJfpegtOWWQRgraMjQ_zGkN7MOtoATpVaoGjTYT7NntTsHPYxA@mail.gmail.com>
On Mon, Feb 24, 2025 at 03:07:03PM +0100, Miklos Szeredi wrote:
> On Mon, 24 Feb 2025 at 02:06, Al Viro <viro@zeniv.linux.org.uk> wrote:
>
> > PS: turns out that set_default_d_op() is slightly more interesting
> > than I expected - fuse has separate dentry_operations for its
> > root dentry. I don't see the point, TBH - the only difference is
> > that root one lacks
> > * ->d_delete() (never even called for root dentry; it's
> > only called if d_unhashed() is false)
> > * ->d_revalidate() (never called for root)
> > * ->d_automount() (not even looked at unless you have
> > S_AUTOMOUNT set on the inode).
> > What's wrong with using fuse_dentry_operations for root dentry?
> > Am I missing something subtle here? Miklos?
>
> Looks like a historical accident:
>
> - initial version only had .d_revalidate and only set d_op in .loookup.
> - then it grew .d_init/.d_release
> - then, as a bugfix, the separate fuse_root_dentry_operations was added
Speaking of historical accidents - "seqlock: Add a new locking reader type"
(introduction of read_seqlock_excl()) happened a week after your
"vfs: check unlinked ancestors before mount" (Sep 12 and Sep 5 2013, resp.)
I'm switching d_set_mounted() from write_seqlock(&rename_lock); to
read_seqlock_excl(&rename_lock) - we need exclusion with movers,
but there's no need for anyone to retry ancestry chains or hash lookups
just because we have marked something as a mountpoint.
IOW, it's a reader, not writer; we can't replace it with need_seqretry
loop without more audit of d_mountpoint() callers I want to mess with
at the moment[*], but exclusive reader is fine.
[*] the ones under ->d_lock are not a problem and so are all that
are followed by "check if something's mounted in our namespace,
ignore if there isn't" as well as the ones that have an exclusion with
the caller of d_set_mounted(), but for now let's not go there.
prev parent reply other threads:[~2025-02-25 17:56 UTC|newest]
Thread overview: 87+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-24 1:06 [RFC] dentry->d_flags locking Al Viro
2025-02-24 1:38 ` Al Viro
2025-02-24 10:35 ` Christian Brauner
2025-02-24 14:14 ` Al Viro
2025-02-24 21:20 ` [PATCH 01/21] procfs: kill ->proc_dops Al Viro
2025-02-24 21:20 ` [PATCH 02/21] new helper: d_splice_alias_ops() Al Viro
2025-02-26 8:28 ` Christian Brauner
2025-02-24 21:20 ` [PATCH 03/21] switch procfs from d_set_d_op() to d_splice_alias_ops() Al Viro
2025-02-26 8:29 ` Christian Brauner
2025-02-24 21:20 ` [PATCH 04/21] fuse: no need for special dentry_operations for root dentry Al Viro
2025-02-26 8:29 ` Christian Brauner
2025-02-27 14:33 ` Miklos Szeredi
2025-02-24 21:20 ` [PATCH 05/21] new helper: set_default_d_op() Al Viro
2025-02-26 8:30 ` Christian Brauner
2025-02-24 21:20 ` [PATCH 06/21] split d_flags calculation out of d_set_d_op() Al Viro
2025-02-26 8:31 ` Christian Brauner
2025-02-24 21:20 ` [PATCH 07/21] set_default_d_op(): calculate the matching value for ->d_flags Al Viro
2025-02-26 8:33 ` Christian Brauner
2025-02-24 21:20 ` [PATCH 08/21] simple_lookup(): just set DCACHE_DONTCACHE Al Viro
2025-02-26 8:34 ` Christian Brauner
2025-02-24 21:20 ` [PATCH 09/21] make d_set_d_op() static Al Viro
2025-02-25 23:09 ` NeilBrown
2025-02-26 8:35 ` Christian Brauner
2025-02-24 21:20 ` [PATCH 10/21] d_alloc_parallel(): set DCACHE_PAR_LOOKUP earlier Al Viro
2025-02-26 8:36 ` Christian Brauner
2025-02-24 21:20 ` [PATCH 11/21] nsfs, pidfs: drop the pointless ->d_delete() Al Viro
2025-02-26 8:37 ` Christian Brauner
2025-02-24 21:20 ` [PATCH 12/21] shmem: no dentry retention past the refcount reaching zero Al Viro
2025-02-26 8:38 ` Christian Brauner
2025-02-24 21:20 ` [PATCH 13/21] devpts, sunrpc: don't bother with ->d_delete or ->d_op, for that matter Al Viro
2025-02-26 8:38 ` Christian Brauner
2025-02-24 21:20 ` [PATCH 14/21] hostfs: don't bother with ->d_op Al Viro
2025-02-26 8:38 ` Christian Brauner
2025-02-24 21:20 ` [PATCH 15/21] kill simple_dentry_operations Al Viro
2025-02-26 8:39 ` Christian Brauner
2025-02-24 21:20 ` [PATCH 16/21] ramfs, hugetlbfs, mqueue: set DCACHE_DONTCACHE Al Viro
2025-02-25 23:25 ` NeilBrown
2025-02-25 23:36 ` Al Viro
2025-02-25 23:40 ` NeilBrown
2025-02-26 8:39 ` Christian Brauner
2025-02-24 21:20 ` [PATCH 17/21] 9p: don't bother with always_delete_dentry Al Viro
2025-02-26 8:40 ` Christian Brauner
2025-02-24 21:20 ` [PATCH 18/21] efivarfs: use DCACHE_DONTCACHE instead of always_delete_dentry() Al Viro
2025-02-26 8:40 ` Christian Brauner
2025-02-24 21:20 ` [PATCH 19/21] debugfs: use DCACHE_DONTCACHE Al Viro
2025-02-26 8:40 ` Christian Brauner
2025-02-24 21:20 ` [PATCH 20/21] configfs: " Al Viro
2025-02-26 8:40 ` Christian Brauner
2025-02-24 21:20 ` [PATCH 21/21] afs dynroot: " Al Viro
2025-02-26 8:41 ` Christian Brauner
2025-02-25 15:55 ` [PATCH 01/21] procfs: kill ->proc_dops Jan Kara
2025-02-25 23:30 ` NeilBrown
2025-02-25 23:56 ` Al Viro
2025-02-25 22:51 ` NeilBrown
2025-02-26 0:03 ` Al Viro
2025-02-26 8:25 ` Christian Brauner
2025-02-26 8:41 ` [RFC] dentry->d_flags locking Christian Brauner
2025-02-24 11:45 ` Christian Brauner
2025-06-11 7:50 ` [RFC][PATCHES v2] " Al Viro
2025-06-11 7:54 ` [PATCH v2 01/21] d_set_mounted(): we don't need to bump seqcount component of rename_lock Al Viro
2025-06-11 7:54 ` [PATCH v2 02/21] procfs: kill ->proc_dops Al Viro
2025-06-11 7:54 ` [PATCH v2 03/21] new helper: d_splice_alias_ops() Al Viro
2025-06-11 7:54 ` [PATCH v2 04/21] switch procfs from d_set_d_op() to d_splice_alias_ops() Al Viro
2025-06-11 7:54 ` [PATCH v2 05/21] fuse: no need for special dentry_operations for root dentry Al Viro
2025-06-11 7:54 ` [PATCH v2 06/21] new helper: set_default_d_op() Al Viro
2025-06-11 7:54 ` [PATCH v2 07/21] split d_flags calculation out of d_set_d_op() Al Viro
2025-06-11 7:54 ` [PATCH v2 08/21] correct the set of flags forbidden at d_set_d_op() time Al Viro
2025-06-11 9:49 ` Christian Brauner
2025-06-11 7:54 ` [PATCH v2 09/21] set_default_d_op(): calculate the matching value for ->d_flags Al Viro
2025-06-11 7:54 ` [PATCH v2 10/21] simple_lookup(): just set DCACHE_DONTCACHE Al Viro
2025-06-11 9:50 ` Christian Brauner
2025-06-11 7:54 ` [PATCH v2 11/21] make d_set_d_op() static Al Viro
2025-06-11 7:54 ` [PATCH v2 12/21] d_alloc_parallel(): set DCACHE_PAR_LOOKUP earlier Al Viro
2025-06-11 7:54 ` [PATCH v2 13/21] shmem: no dentry retention past the refcount reaching zero Al Viro
2025-06-11 7:54 ` [PATCH v2 14/21] devpts, sunrpc, hostfs: don't bother with ->d_op Al Viro
2025-06-11 9:50 ` Christian Brauner
2025-06-11 7:54 ` [PATCH v2 15/21] kill simple_dentry_operations Al Viro
2025-06-11 7:54 ` [PATCH v2 16/21] ramfs, hugetlbfs, mqueue: set DCACHE_DONTCACHE Al Viro
2025-06-11 7:54 ` [PATCH v2 17/21] 9p: don't bother with always_delete_dentry Al Viro
2025-06-11 7:54 ` [PATCH v2 18/21] efivarfs: use DCACHE_DONTCACHE instead of always_delete_dentry() Al Viro
2025-06-11 7:54 ` [PATCH v2 19/21] debugfs: use DCACHE_DONTCACHE Al Viro
2025-06-11 7:54 ` [PATCH v2 20/21] configfs: " Al Viro
2025-06-11 7:54 ` [PATCH v2 21/21] tracefs: set DCACHE_DONTCACHE Al Viro
2025-06-11 9:51 ` Christian Brauner
2025-06-11 9:47 ` [RFC][PATCHES v2] dentry->d_flags locking Christian Brauner
2025-02-24 14:07 ` [RFC] " Miklos Szeredi
2025-02-25 17:56 ` Al Viro [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250225175634.GY1977892@ZenIV \
--to=viro@zeniv.linux.org.uk \
--cc=brauner@kernel.org \
--cc=jack@suse.cz \
--cc=linux-fsdevel@vger.kernel.org \
--cc=miklos@szeredi.hu \
--cc=neilb@suse.de \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.