linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] export mount info for "unmounted" mounts
@ 2025-10-02 12:48 Bhavik Sachdev
  2025-10-02 12:48 ` [PATCH 1/4] fs/namespace: add umount_mnt_ns mount namespace for unmounted mounts Bhavik Sachdev
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Bhavik Sachdev @ 2025-10-02 12:48 UTC (permalink / raw)
  To: Alexander Viro, Christian Brauner
  Cc: linux-fsdevel, linux-kernel, Aleksa Sarai, Bhavik Sachdev,
	Pavel Tikhomirov, Jan Kara, John Garry, Arnaldo Carvalho de Melo,
	Darrick J . Wong, Namhyung Kim, Ingo Molnar, Andrei Vagin,
	Alexander Mikhalitsyn

By "unmounted" mounts we mean mounts that have been unmounted using
umount2(mnt, MNT_DETACH) but we still have file descriptors to files on
that mount. We want to add the ability to handle such mounts in CRIU
(Checkpoint/Restore in Userspace).

Currently, we have no way to get mount info for these mounts as they do
not appear in /proc/<pid>/mountinfo and statmount does not work on them.

We solve this problem by introducing a new umount_mnt_ns for such
mounts. Instead of their namespace being NULL, they get added to this
umount_mnt_ns. This allows us to use statmount on such mounts and export
their mnt_ns_id through statx.

We use this patchset with CRIU to support checkpoint/restore of
"unmounted" mounts in this pull request:
https://github.com/checkpoint-restore/criu/pull/2754.

All these patches are also available in this branch on github:
https://github.com/bsach64/linux/tree/umount-mnt-ns-plus-statx

Bhavik Sachdev (2):
  statmount: allow for "unmounted" mounts
  fs/stat: export mnt_ns_id through statx

Pavel Tikhomirov (2):
  fs/namespace: add umount_mnt_ns mount namespace for unmounted mounts
  fs/namespace: add umounted mounts to umount_mnt_ns

 fs/d_path.c                     |  2 +-
 fs/mount.h                      | 10 +++++-
 fs/namespace.c                  | 62 ++++++++++++++++++++++++++++-----
 fs/stat.c                       | 15 ++++++--
 include/linux/proc_ns.h         |  1 +
 include/linux/stat.h            |  1 +
 include/uapi/linux/nsfs.h       |  1 +
 include/uapi/linux/stat.h       |  4 ++-
 tools/include/uapi/linux/stat.h |  4 ++-
 9 files changed, 85 insertions(+), 15 deletions(-)

-- 
2.51.0


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2025-10-07 18:41 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-02 12:48 [PATCH 0/4] export mount info for "unmounted" mounts Bhavik Sachdev
2025-10-02 12:48 ` [PATCH 1/4] fs/namespace: add umount_mnt_ns mount namespace for unmounted mounts Bhavik Sachdev
2025-10-02 12:48 ` [PATCH 2/4] fs/namespace: add umounted mounts to umount_mnt_ns Bhavik Sachdev
2025-10-02 16:34   ` Al Viro
2025-10-03  5:03     ` Pavel Tikhomirov
2025-10-06 13:45       ` Christian Brauner
2025-10-07 18:40         ` Aleksa Sarai
2025-10-02 12:48 ` [PATCH 3/4] statmount: allow for "unmounted" mounts Bhavik Sachdev
2025-10-02 12:48 ` [PATCH 4/4] fs/stat: export mnt_ns_id through statx Bhavik Sachdev

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).