linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christian Brauner <brauner@kernel.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Christian Brauner <brauner@kernel.org>,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [GIT PULL] vfs mount
Date: Fri, 13 Sep 2024 16:41:58 +0200	[thread overview]
Message-ID: <20240913-vfs-mount-ff71ba96c312@brauner> (raw)

Hey Linus,

/* Summary */

Recently, we added the ability to list mounts in other mount namespaces
and the ability to retrieve namespace file descriptors without having to
go through procfs by deriving them from pidfds.

This extends nsfs in two ways:

(1) Add the ability to retrieve information about a mount namespace via
    NS_MNT_GET_INFO. This will return the mount namespace id and the
    number of mounts currently in the mount namespace. The number of
    mounts can be used to size the buffer that needs to be used for
    listmount() and is in general useful without having to actually
    iterate through all the mounts.

    The structure is extensible.

(2) Add the ability to iterate through all mount namespaces over which
    the caller holds privilege returning the file descriptor for the
    next or previous mount namespace.

    To retrieve a mount namespace the caller must be privileged wrt to
    it's owning user namespace. This means that PID 1 on the host can
    list all mounts in all mount namespaces or that a container can list
    all mounts of its nested containers.

    Optionally pass a structure for NS_MNT_GET_INFO with
    NS_MNT_GET_{PREV,NEXT} to retrieve information about the mount
    namespace in one go.

(1) and (2) can be implemented for other namespace types easily.

Together with recent api additions this means one can iterate through
all mounts in all mount namespaces without ever touching procfs. The
merge message contains example code how to do this.

/* Testing */

gcc version 14.2.0 (Debian 14.2.0-3)
Debian clang version 16.0.6 (27+b1)

All patches are based on v6.11-rc1 and have been sitting in linux-next.
No build failures or warnings were observed.

/* Conflicts */

Merge conflicts with mainline
=============================

No known conflicts.

Merge conflicts with other trees
================================

(1) linux-next: build failure after merge of the bpf-next tree
    https://lore.kernel.org/r/20240913133240.066ae790@canb.auug.org.au

    The reported merge conflict isn't really with bpf-next but with the
    series to convert to fd_file() accessors for the changed struct fd
    representation.

    The patch you need to fix this however is correct in that draft. But
    honestly, it's pretty easy for you to figure out on your own anyway.

The following changes since commit 8400291e289ee6b2bf9779ff1c83a291501f017b:

  Linux 6.11-rc1 (2024-07-28 14:19:55 -0700)

are available in the Git repository at:

  git@gitolite.kernel.org:pub/scm/linux/kernel/git/vfs/vfs tags/vfs-6.12.mount

for you to fetch changes up to 49224a345c488a0e176f193a60a2a76e82349e3e:

  Merge patch series "nsfs: iterate through mount namespaces" (2024-08-09 12:47:05 +0200)

Please consider pulling these changes from the signed vfs-6.12.mount tag.

Thanks!
Christian

----------------------------------------------------------------
vfs-6.12.mount

----------------------------------------------------------------
Christian Brauner (5):
      fs: allow mount namespace fd
      fs: add put_mnt_ns() cleanup helper
      file: add fput() cleanup helper
      nsfs: iterate through mount namespaces
      Merge patch series "nsfs: iterate through mount namespaces"

 fs/mount.h                    |  13 ++++++
 fs/namespace.c                |  74 +++++++++++++++++++++++++-----
 fs/nsfs.c                     | 102 +++++++++++++++++++++++++++++++++++++++++-
 include/linux/file.h          |   2 +
 include/linux/mnt_namespace.h |   4 ++
 include/uapi/linux/nsfs.h     |  16 +++++++
 6 files changed, 198 insertions(+), 13 deletions(-)

             reply	other threads:[~2024-09-13 14:42 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-13 14:41 Christian Brauner [this message]
2024-09-14  2:33 ` [GIT PULL] vfs mount Stephen Rothwell
2024-09-16 11:09 ` pr-tracker-bot
  -- strict thread matches above, loose matches on Subject: below --
2025-03-22 10:13 Christian Brauner
2025-03-24 21:00 ` pr-tracker-bot
2025-04-01 17:07   ` Leon Romanovsky
2025-04-03  8:29     ` Christian Brauner
2025-04-03 15:15       ` Christian Brauner
2025-04-03 15:34         ` James Bottomley
2025-04-03 17:21           ` Mateusz Guzik
2025-04-03 18:09             ` Linus Torvalds
2025-04-03 19:17               ` Mateusz Guzik
2025-04-04  8:28               ` Christoph Hellwig
2025-04-04 14:19                 ` Linus Torvalds
2025-04-07  8:51                   ` Christoph Hellwig
2025-04-07 16:00                     ` Linus Torvalds
2025-04-08  5:06                       ` Christoph Hellwig
2025-04-07 11:22                   ` Christian Brauner
2025-04-03 18:24         ` Leon Romanovsky
2025-04-03 19:18           ` Linus Torvalds
2025-04-03 19:45             ` Christian Brauner
2025-04-03 19:55               ` Christian Brauner
2025-04-04  6:16             ` Leon Romanovsky
2025-04-03 19:38           ` James Bottomley
2025-01-18 13:06 Christian Brauner
2025-01-20  0:10 ` Sasha Levin
2025-01-20 12:21   ` Christian Brauner
2025-01-20 18:59 ` pr-tracker-bot
2024-05-10 11:46 Christian Brauner
2024-05-13 19:38 ` pr-tracker-bot
2023-06-23 11:03 [GIT PULL] vfs: mount Christian Brauner
2023-06-26 17:34 ` 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=20240913-vfs-mount-ff71ba96c312@brauner \
    --to=brauner@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@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).