linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Al Viro <viro@zeniv.linux.org.uk>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: linux-fsdevel@vger.kernel.org, Christian Brauner <brauner@kernel.org>
Subject: Re: [git pull] pile 1: mount stuff
Date: Fri, 3 Oct 2025 22:13:51 +0100	[thread overview]
Message-ID: <20251003211351.GA1738725@ZenIV> (raw)
In-Reply-To: <CAHk-=wjwQpQQb8A5594h8fTODkLHLBuw23TK1jL=Y9CLckR0kw@mail.gmail.com>

On Fri, Oct 03, 2025 at 10:45:02AM -0700, Linus Torvalds wrote:

> What do you think? This patch is ENTIRELY UNTESTED. It compiled for
> me, that's all I can say. It *looks* fine, and it reads nicely and
> groups those variables with the lock that protects them. But it's a
> quick throw-away patch for "maybe something like this?"

Gathering those into a single object makes sense, the only thing that
worries me is that it is suggesting that we might want to have multiple
instances of the entire thing...

One obvious problem is notify_list and mnt_notify_add(); it's not
impossible to deal with.  The only reason it's not static is the
call in reparent(), and I'm not at all sure it needs to be there -
we are sliding something from under an overmount and I don't see
why would anybody want a notification for watchers of that
overmount, especially since nothing is generated for the things
overmounting it, etc.

Last cycle's pile had been way too large as it is, so I decided to
leave dealign with that magical mystery shite for later; might as well
do it this cycle...

>  /*
> - * locks: mount_lock [read_seqlock_excl], namespace_sem [excl]
> + * locks: mount_lock [read_seqlock_excl], fs_namespace.sem [excl]

 * locks: mount_locked_reader, namespace_excl

would be better, IMO.  I didn't switch those comments since the series had
already been getting too long, but I think refering to locking conditions
by guard names is better than going by lock name + type of access.

> -/* iterator; we want it to have access to namespace_sem, thus here... */
> +/* iterator; we want it to have access to fs_namespace.sem, thus here... */

Stale comment, really - mnt_find_id_at() is static, to start with...
Originally it had been explaining why that thing (used in fs/proc_namespace.c)
stayed behind in fs/namespace.c; these days it's not obvious that comment is
needed in the first place, but if we want to explain that, we would be better
off with something like "iterator; used only by fs/proc_namespace.c, kept here
since it uses mount rbtree of namespace and we don't want to expose the details
of that outside of fs/namespace.c"...

> -		emptied_ns = m->mnt_ns;
> +		fs_namespace.emptied_ns = m->mnt_ns;

Might be worth an inlined helper...

> -	rwsem_assert_held(&namespace_sem);
> +	rwsem_assert_held(&fs_namespace.sem);

... as well as this one, really.

  reply	other threads:[~2025-10-03 21:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-02  5:54 [git pull] pile 1: mount stuff Al Viro
2025-10-03 17:45 ` Linus Torvalds
2025-10-03 21:13   ` Al Viro [this message]
2025-10-03 21:19     ` Linus Torvalds
2025-10-03 18:41 ` pr-tracker-bot

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=20251003211351.GA1738725@ZenIV \
    --to=viro@zeniv.linux.org.uk \
    --cc=brauner@kernel.org \
    --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;
as well as URLs for NNTP newsgroup(s).