[Devel] [PATCH rh7] nsproxy: drop INIT_NSPROXY_COUNT

Vladimir Davydov vdavydov at parallels.com
Sun Jun 21 08:38:13 PDT 2015


In case of CONFIG_VE we init init_nsproxy.count to 2 instead of 1,
explaining this by the fact that both ve0 and init_task need to hold a
reference to init_nsproxy. Actually, neither ve0 nor init_task can die,
so there is absolutely no point in this change, so revert it in order
not to clutter our kernel patch.

This patch reverts 20db9ba844e49 ("VE/NSPROXY: fix refcounting of
init_nsproxy") and parts of the initial commit 1da9426dc5c49.

Signed-off-by: Vladimir Davydov <vdavydov at parallels.com>
---
 include/linux/init_task.h | 7 -------
 kernel/nsproxy.c          | 2 +-
 2 files changed, 1 insertion(+), 8 deletions(-)

diff --git a/include/linux/init_task.h b/include/linux/init_task.h
index 56afd2b53ba5..b1bdeb643656 100644
--- a/include/linux/init_task.h
+++ b/include/linux/init_task.h
@@ -58,13 +58,6 @@ extern struct fs_struct init_fs;
 	INIT_GROUP_RWSEM(sig)						\
 }
 
-#ifdef CONFIG_VE
-/* one more for ve0 */
-#define INIT_NSPROXY_COUNT	ATOMIC_INIT(2)
-#else
-#define INIT_NSPROXY_COUNT	ATOMIC_INIT(1)
-#endif
-
 extern struct nsproxy init_nsproxy;
 
 #define INIT_SIGHAND(sighand) {						\
diff --git a/kernel/nsproxy.c b/kernel/nsproxy.c
index 769eeeceb6ab..79983abdf563 100644
--- a/kernel/nsproxy.c
+++ b/kernel/nsproxy.c
@@ -29,7 +29,7 @@
 static struct kmem_cache *nsproxy_cachep;
 
 struct nsproxy init_nsproxy = {
-	.count	= INIT_NSPROXY_COUNT,
+	.count	= ATOMIC_INIT(1),
 	.uts_ns	= &init_uts_ns,
 #if defined(CONFIG_POSIX_MQUEUE) || defined(CONFIG_SYSVIPC)
 	.ipc_ns	= &init_ipc_ns,
-- 
2.1.4




More information about the Devel mailing list