Skip to content

export mount info for "unmounted" mounts

Bhavik Sachdev linux-fsdevel lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4fs/namespace: add umount_mnt_ns mount namespace for unmounted mountsfs/namespace.c include/linux/proc_ns.h include/uapi/linux/nsfs.h+16 -00 replies
2/4fs/namespace: add umounted mounts to umount_mnt_nsfs/d_path.c fs/mount.h fs/namespace.c+30 -54 replies
3/4statmount: allow for "unmounted" mountsfs/namespace.c+19 -60 replies
4/4fs/stat: export mnt_ns_id through statxfs/stat.c include/linux/stat.h include/uapi/linux/stat.h +1 more+20 -40 replies

Reviews trailers per patch

None of the 4 patches has a Reviewed-by or Acked-by.

PatchAl Viro
1/4
2/4NAKed-by
3/4
4/4

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/4] export mount info for "unmounted" mounts

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(-)
Signature · 1 line
2.51.0