Linux filesystem development
 help / color / mirror / Atom feed
From: Al Viro <viro@zeniv.linux.org.uk>
To: Christian Brauner <brauner@kernel.org>
Cc: linux-fsdevel@vger.kernel.org,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Jann Horn <jannh@google.com>, Jan Kara <jack@suse.cz>,
	Amir Goldstein <amir73il@gmail.com>
Subject: Re: [PATCH 2/3] namespace: rework connected mounts
Date: Sun, 18 Oct 2026 04:15:22 +0100	[thread overview]
Message-ID: <20261018031522.GC3535232@ZenIV> (raw)
In-Reply-To: <20261002-work-mount-cover-v1-2-232a8f52b43c@kernel.org>

On Fri, Oct 02, 2026 at 04:14:28PM +0200, Christian Brauner wrote:

> +/*
> + * What an unmounted mount leaves behind at its unmounted parent instead of
> + * staying attached to it. A lookup on the parent at the mountpoint finds
> + * a stand-in for as long as the cover is there. The parent frees it.
> + */
> +struct mnt_cover {
> +	struct hlist_node node;		/* parent->mnt_covers, RCU */
> +	struct hlist_node pin;		/* mp->m_covers, keeps the mountpoint */

Is there any point for that to be an hlist?  I mean, you only ever add to
the head, walk it only forward and remove them one by one as you walk...
What's wrong with plain struct mnt_cover *next; instead?

> +	struct dentry *dentry;
> +	struct mountpoint *mp;
> +	struct rcu_head rcu;
> +};

... and seeing that the only place where you have a lockless traversal of
->node is only looking at ->dentry, it might make sense to make that
	struct hlist_node node;		/* parent->mnt_covers, RCU */
	struct dentry *dentry;
	union {
		struct {	// never used by lockless readers
			struct mnt_cover *next;
			struct mountpoint *mp;
		}
		struct rcu_head rcu;
	}
perhaps?

  reply	other threads:[~2026-10-18  3:15 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-02 14:14 [PATCH 0/3] namespace: rework connected mounts Christian Brauner
2026-10-02 14:14 ` [PATCH 1/3] nullfs: add an empty immutable regular file Christian Brauner
2026-10-02 14:31   ` Jann Horn
2026-10-05 10:33     ` Christian Brauner
2026-10-02 14:14 ` [PATCH 2/3] namespace: rework connected mounts Christian Brauner
2026-10-18  3:15   ` Al Viro [this message]
2026-10-18 16:32     ` Christian Brauner
2026-10-18  3:54   ` Al Viro
2026-10-18 16:30     ` Christian Brauner
2026-10-02 14:14 ` [PATCH 3/3] selftests/filesystems: test covered mounts Christian Brauner

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=20261018031522.GC3535232@ZenIV \
    --to=viro@zeniv.linux.org.uk \
    --cc=amir73il@gmail.com \
    --cc=brauner@kernel.org \
    --cc=jack@suse.cz \
    --cc=jannh@google.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox