Skip to content

ns: rework reference counting

Christian Brauner cgroups linux-fsdevel lkml netdev 1 version In review

Get series with b4
b4 am [email protected] change-id 20250917-work-namespace-ns_ref-357162ca7aa8

Versions newest first

  1. v1 Latest14 patches 5 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/14ns: add reference count helpersinclude/linux/ns_common.h+35 -100 replies
2/14mnt: port to ns_ref_*() helpersfs/mount.h fs/namespace.c+3 -30 replies
3/14cgroup: port to ns_ref_*() helpersinclude/linux/cgroup_namespace.h+2 -21 reply
4/14ipc: port to ns_ref_*() helpersinclude/linux/ipc_namespace.h ipc/namespace.c+3 -30 replies
5/14pid: port to ns_ref_*() helpersinclude/linux/pid_namespace.h kernel/pid_namespace.c+3 -30 replies
6/14time: port to ns_ref_*() helpersinclude/linux/time_namespace.h+2 -21 reply
7/14user: port to ns_ref_*() helpersinclude/linux/user_namespace.h kernel/user_namespace.c+3 -30 replies
8/14net-sysfs: use check_net()net/core/net-sysfs.c+3 -30 replies
9/14net: use check_net()net/core/net_namespace.c+1 -10 replies
10/14ipv4: use check_net()net/ipv4/inet_timewait_sock.c net/ipv4/tcp_metrics.c+3 -30 replies
11/14uts: port to ns_ref_*() helpersinclude/linux/uts_namespace.h+2 -20 replies
12/14net: port to ns_ref_*() helpersinclude/net/net_namespace.h+4 -40 replies
13/14nsfs: port to ns_ref_*() helpersfs/nsfs.c+1 -10 replies
14/14ns: rename to __ns_refinclude/linux/ns_common.h init/version-timestamp.c ipc/msgutil.c +5 more+13 -132 replies

Reviews trailers per patch

3 of 14 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchJan KaraTejun HeoThomas Gleixner
SeriesR-b
1/14
2/14
3/14A-b
4/14
5/14
6/14R-b
7/14
8/14
9/14
10/14
11/14
12/14
13/14
14/14A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v1 thread

Cover letter [PATCH 00/14] ns: rework reference counting

Stop open accesses to the reference counts and cargo-culting the same code in all namespace. Use a set of dedicated helpers and make the actual count private.

---
Christian Brauner (14):
ns: add reference count helpers
mnt: port to ns_ref_*() helpers
cgroup: port to ns_ref_*() helpers
ipc: port to ns_ref_*() helpers
pid: port to ns_ref_*() helpers
time: port to ns_ref_*() helpers
user: port to ns_ref_*() helpers
net-sysfs: use check_net()
net: use check_net()
ipv4: use check_net()
uts: port to ns_ref_*() helpers
net: port to ns_ref_*() helpers
nsfs: port to ns_ref_*() helpers
ns: rename to __ns_ref

 fs/mount.h                       |  2 +-
 fs/namespace.c                   |  4 ++--
 fs/nsfs.c                        |  2 +-
 include/linux/cgroup_namespace.h |  4 ++--
 include/linux/ipc_namespace.h    |  4 ++--
 include/linux/ns_common.h        | 47 ++++++++++++++++++++++++++++++----------
 include/linux/pid_namespace.h    |  2 +-
 include/linux/time_namespace.h   |  4 ++--
 include/linux/user_namespace.h   |  4 ++--
 include/linux/uts_namespace.h    |  4 ++--
 include/net/net_namespace.h      |  8 +++----
 init/version-timestamp.c         |  2 +-
 ipc/msgutil.c                    |  2 +-
 ipc/namespace.c                  |  2 +-
 kernel/cgroup/cgroup.c           |  2 +-
 kernel/nscommon.c                |  2 +-
 kernel/pid.c                     |  2 +-
 kernel/pid_namespace.c           |  4 ++--
 kernel/time/namespace.c          |  2 +-
 kernel/user.c                    |  2 +-
 kernel/user_namespace.c          |  2 +-
 net/core/net-sysfs.c             |  6 ++---
 net/core/net_namespace.c         |  2 +-
 net/ipv4/inet_timewait_sock.c    |  4 ++--
 net/ipv4/tcp_metrics.c           |  2 +-
 25 files changed, 73 insertions(+), 48 deletions(-)

---
base-commit: 3f9cc273c16f63b5d584ec4e767918765c44316b
change-id: 20250917-work-namespace-ns_ref-357162ca7aa8