summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
Diffstat (limited to 'fs')
-rw-r--r--fs/namespace.c1
-rw-r--r--fs/proc/inode.c6
2 files changed, 3 insertions, 4 deletions
diff --git a/fs/namespace.c b/fs/namespace.c
index 30738d200866..f815218f92d3 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -2672,6 +2672,7 @@ static struct mnt_namespace *alloc_mnt_ns(struct user_namespace *user_ns)
kfree(new_ns);
return ERR_PTR(ret);
}
+ new_ns->ns.ops = &mntns_operations;
new_ns->seq = atomic64_add_return(1, &mnt_ns_seq);
atomic_set(&new_ns->count, 1);
new_ns->root = NULL;
diff --git a/fs/proc/inode.c b/fs/proc/inode.c
index 43b703c6cd3b..a212996e0987 100644
--- a/fs/proc/inode.c
+++ b/fs/proc/inode.c
@@ -32,7 +32,6 @@ static void proc_evict_inode(struct inode *inode)
{
struct proc_dir_entry *de;
struct ctl_table_header *head;
- const struct proc_ns_operations *ns_ops;
struct ns_common *ns;
truncate_inode_pages_final(&inode->i_data);
@@ -51,10 +50,9 @@ static void proc_evict_inode(struct inode *inode)
sysctl_head_put(head);
}
/* Release any associated namespace */
- ns_ops = PROC_I(inode)->ns.ns_ops;
ns = PROC_I(inode)->ns.ns;
- if (ns_ops && ns)
- ns_ops->put(ns);
+ if (ns && ns->ops)
+ ns->ops->put(ns);
}
static struct kmem_cache * proc_inode_cachep;
OpenPOWER on IntegriCloud