namespaces: utsname: fix wrong comment about clone_uts_ns()
PATCH 1/3 namespaces: utsname: fix wrong comment about clone_uts_ns()
Fix the wrong comment about the return value of clone_uts_ns()
Cc Serge Hallyn <[email protected]>
Signed-off-by Yuanhan Liu <[email protected]>
--- kernel/utsname.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
kernel/utsname.c +1 -1
@@ -30,7 +30,7 @@ static struct uts_namespace *create_uts_ns(void)/* * Clone a new ns copying an original utsname, setting refcount to 1 * @old_ns: namespace to clone -* Return NULL on error (failure to kmalloc), new ns otherwise +* Return ERR_PTR(-ENOMEM) on error (failure to kmalloc), new ns otherwise */ static struct uts_namespace *clone_uts_ns (struct user_namespace *user_ns,struct uts_namespace *old_ns)
Signature · 1 line
1.7.7.6
PATCH 2/3 sysctl: put get/get_uts() into CONFIG_PROC_SYSCTL code block
put get/get_uts() into CONFIG_PROC_SYSCTL code block as they are used only when CONFIG_PROC_SYSCTL is enabled.
Signed-off-by Yuanhan Liu <[email protected]>
--- kernel/utsname_sysctl.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
kernel/utsname_sysctl.c +2 -1
@@ -15,6 +15,8 @@#include <linux/sysctl.h> #include <linux/wait.h> +#ifdef CONFIG_PROC_SYSCTL +static void *get_uts (ctl_table *table,int write) {char *which = table->data;
@@ -38,7 +40,6 @@ static void put_uts(ctl_table *table, int write, void *which)up_write (&uts_sem); } -#ifdef CONFIG_PROC_SYSCTL /* * Special case of dostring for the UTS structure. This has locks * to observe. Should this be in kernel/sys.c ????
Signature · 1 line
1.7.7.6
PATCH 3/3 nsproxy: remove duplicate task_cred_xxx for user_ns
In reply to Yuanhan LiuWe can use user_ns, which is also assigned from task_cred_xxx(tsk, user_ns), at the beginning of copy_namespaces().
Cc Serge Hallyn <[email protected]>
Signed-off-by Yuanhan Liu <[email protected]>
--- kernel/nsproxy.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-)
kernel/nsproxy.c +1 -2
@@ -153,8 +153,7 @@ int copy_namespaces(unsigned long flags, struct task_struct *tsk) goto out; } - new_ns =create_new_namespaces (flags, tsk, -task_cred_xxx (tsk, user_ns), tsk->fs); + new_ns =create_new_namespaces (flags, tsk, user_ns, tsk->fs);if (IS_ERR (new_ns)) { err =PTR_ERR (new_ns); goto out;
Signature · 1 line
1.7.7.6
Re: [PATCH 3/3] nsproxy: remove duplicate task_cred_xxx for user_ns
Quoted 4 lines · Yuanhan Liu
We can use
user_ns, which is also assigned fromtask_cred_xxx(tsk, user_ns), at the beginning ofcopy_namespaces().Cc Serge Hallyn <[email protected]>
Acked-by Serge Hallyn <[email protected]>
Quoted 27 lines
Signed-off-by Yuanhan Liu <[email protected]>--- kernel/nsproxy.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-)kernel/nsproxy.c +1
-2@@ -153,8 +153,7 @@ int copy_namespaces(unsigned long flags, struct task_struct *tsk) goto out; } - new_ns =create_new_namespaces (flags, tsk, -task_cred_xxx (tsk, user_ns), tsk->fs); + new_ns =create_new_namespaces (flags, tsk, user_ns, tsk->fs);if (IS_ERR (new_ns)) { err =PTR_ERR (new_ns); goto out;Signature · 7 lines
1.7.7.6 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Quoted 3 lines · Yuanhan Liu
Fix the wrong comment about the return value of
clone_uts_ns()Cc Serge Hallyn <[email protected]>
Acked-by Serge Hallyn <[email protected]>
Quoted 26 lines
Signed-off-by Yuanhan Liu <[email protected]>--- kernel/utsname.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)kernel/utsname.c +1
-1@@ -30,7 +30,7 @@ static struct uts_namespace *create_uts_ns(void)/* * Clone a new ns copying an original utsname, setting refcount to 1 * @old_ns: namespace to clone -* Return NULL on error (failure to kmalloc), new ns otherwise +* Return ERR_PTR(-ENOMEM) on error (failure to kmalloc), new ns otherwise */ static struct uts_namespace *clone_uts_ns (struct user_namespace *user_ns,struct uts_namespace *old_ns)Signature · 7 lines
1.7.7.6 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/