[userns/for-testing] set ucounts for mount namespaces

Submitted by Andrei Vagin on Aug. 10, 2016, 6:55 p.m.

Details

Message ID 1470855345-17274-1-git-send-email-avagin@openvz.org
State New
Series "set ucounts for mount namespaces"
Headers show

Commit Message

Andrei Vagin Aug. 10, 2016, 6:55 p.m.
It is used in free_mnt_ns():
        dec_mnt_namespaces(ns->ucounts);

Signed-off-by: Andrei Vagin <avagin@openvz.org>
---
 fs/namespace.c | 1 +
 1 file changed, 1 insertion(+)

Patch hide | download patch | download mbox

diff --git a/fs/namespace.c b/fs/namespace.c
index 0873371..491b8f3 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -2775,6 +2775,7 @@  static struct mnt_namespace *alloc_mnt_ns(struct user_namespace *user_ns)
 	init_waitqueue_head(&new_ns->poll);
 	new_ns->event = 0;
 	new_ns->user_ns = get_user_ns(user_ns);
+	new_ns->ucounts = ucounts;
 	return new_ns;
 }
 

Comments

Eric W. Biederman Aug. 31, 2016, 12:43 p.m.
Andrei Vagin <avagin@openvz.org> writes:

> It is used in free_mnt_ns():
>         dec_mnt_namespaces(ns->ucounts);

Doh!

Thank you for catching this.

Eric


> Signed-off-by: Andrei Vagin <avagin@openvz.org>
> ---
>  fs/namespace.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/fs/namespace.c b/fs/namespace.c
> index 0873371..491b8f3 100644
> --- a/fs/namespace.c
> +++ b/fs/namespace.c
> @@ -2775,6 +2775,7 @@ static struct mnt_namespace *alloc_mnt_ns(struct user_namespace *user_ns)
>  	init_waitqueue_head(&new_ns->poll);
>  	new_ns->event = 0;
>  	new_ns->user_ns = get_user_ns(user_ns);
> +	new_ns->ucounts = ucounts;
>  	return new_ns;
>  }