[Devel] [PATCH RH7 09/32] Revert "ms/ns: allow ns_entries to have custom symlink content"

Pavel Tikhomirov ptikhomirov at virtuozzo.com
Mon Jun 8 20:05:39 MSK 2020


This reverts commit 2b151c3f890947af0f9ad091cfc00e74cfdfcdce.

We switch from procfs ns-files to nsfs ones, so we will apply nsfs
version of the patch instead.

https://jira.sw.ru/browse/PSBM-102357

Signed-off-by: Pavel Tikhomirov <ptikhomirov at virtuozzo.com>
---
 fs/proc/namespaces.c    | 4 +---
 include/linux/proc_ns.h | 1 -
 2 files changed, 1 insertion(+), 4 deletions(-)

diff --git a/fs/proc/namespaces.c b/fs/proc/namespaces.c
index 6976ef6cb193..86aff3a43db2 100644
--- a/fs/proc/namespaces.c
+++ b/fs/proc/namespaces.c
@@ -150,7 +150,6 @@ static int proc_ns_readlink(struct dentry *dentry, char __user *buffer, int bufl
 	struct proc_inode *ei = PROC_I(inode);
 	const struct proc_ns_operations *ns_ops = ei->ns.ns_ops;
 	struct task_struct *task;
-	const char *link_name;
 	void *ns;
 	char name[50];
 	int len = -EACCES;
@@ -167,8 +166,7 @@ static int proc_ns_readlink(struct dentry *dentry, char __user *buffer, int bufl
 	if (!ns)
 		goto out_put_task;
 
-	link_name = ns_ops->real_ns_name ? : ns_ops->name;
-	snprintf(name, sizeof(name), "%s:[%u]", link_name, ns_ops->inum(ns));
+	snprintf(name, sizeof(name), "%s:[%u]", ns_ops->name, ns_ops->inum(ns));
 	len = strlen(name);
 
 	if (len > buflen)
diff --git a/include/linux/proc_ns.h b/include/linux/proc_ns.h
index b8dc2bca2575..5478e144c50a 100644
--- a/include/linux/proc_ns.h
+++ b/include/linux/proc_ns.h
@@ -10,7 +10,6 @@ struct nsproxy;
 
 struct proc_ns_operations {
 	const char *name;
-	const char *real_ns_name;
 	int type;
 	void *(*get)(struct task_struct *task);
 	void (*put)(void *ns);
-- 
2.24.1



More information about the Devel mailing list