[lkml]   [2020]   [Apr]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[tip: timers/urgent] ucount: Make sure ucounts in /proc/sys/user don't regress again
The following commit has been merged into the timers/urgent branch of tip:

Commit-ID: 0f538e3e712a517bd351607de50cd298102c7c08
Author: Jan Kara <>
AuthorDate: Tue, 07 Apr 2020 17:46:43 +02:00
Committer: Thomas Gleixner <>
CommitterDate: Tue, 07 Apr 2020 21:51:27 +02:00

ucount: Make sure ucounts in /proc/sys/user don't regress again

Commit 769071ac9f20 "ns: Introduce Time Namespace" broke reporting of
inotify ucounts (max_inotify_instances, max_inotify_watches) in
/proc/sys/user because it has added UCOUNT_TIME_NAMESPACES into enum
ucount_type but didn't properly update reporting in
kernel/ucount.c:setup_userns_sysctls(). This problem got fixed in commit
eeec26d5da82 "time/namespace: Add max_time_namespaces ucount".

Add BUILD_BUG_ON to catch a similar problem in the future.

Signed-off-by: Jan Kara <>
Signed-off-by: Thomas Gleixner <>
Acked-by: Andrei Vagin <>

kernel/ucount.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/kernel/ucount.c b/kernel/ucount.c
index 29c60eb..11b1596 100644
--- a/kernel/ucount.c
+++ b/kernel/ucount.c
@@ -82,6 +82,8 @@ bool setup_userns_sysctls(struct user_namespace *ns)
struct ctl_table *tbl;
setup_sysctl_set(&ns->set, &set_root, set_is_seen);
tbl = kmemdup(user_table, sizeof(user_table), GFP_KERNEL);
if (tbl) {
 \ /
  Last update: 2020-04-07 21:54    [W:0.032 / U:3.096 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site