aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/nsfs.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/fs/nsfs.c b/fs/nsfs.c
index fb7b397a1297..30bb10034120 100644
--- a/fs/nsfs.c
+++ b/fs/nsfs.c
@@ -51,7 +51,7 @@ static void nsfs_evict(struct inode *inode)
51 51
52static void *__ns_get_path(struct path *path, struct ns_common *ns) 52static void *__ns_get_path(struct path *path, struct ns_common *ns)
53{ 53{
54 struct vfsmount *mnt = mntget(nsfs_mnt); 54 struct vfsmount *mnt = nsfs_mnt;
55 struct qstr qname = { .name = "", }; 55 struct qstr qname = { .name = "", };
56 struct dentry *dentry; 56 struct dentry *dentry;
57 struct inode *inode; 57 struct inode *inode;
@@ -67,7 +67,7 @@ static void *__ns_get_path(struct path *path, struct ns_common *ns)
67 rcu_read_unlock(); 67 rcu_read_unlock();
68 ns->ops->put(ns); 68 ns->ops->put(ns);
69got_it: 69got_it:
70 path->mnt = mnt; 70 path->mnt = mntget(mnt);
71 path->dentry = dentry; 71 path->dentry = dentry;
72 return NULL; 72 return NULL;
73slow: 73slow:
@@ -75,7 +75,6 @@ slow:
75 inode = new_inode_pseudo(mnt->mnt_sb); 75 inode = new_inode_pseudo(mnt->mnt_sb);
76 if (!inode) { 76 if (!inode) {
77 ns->ops->put(ns); 77 ns->ops->put(ns);
78 mntput(mnt);
79 return ERR_PTR(-ENOMEM); 78 return ERR_PTR(-ENOMEM);
80 } 79 }
81 inode->i_ino = ns->inum; 80 inode->i_ino = ns->inum;
@@ -88,7 +87,6 @@ slow:
88 dentry = d_alloc_pseudo(mnt->mnt_sb, &qname); 87 dentry = d_alloc_pseudo(mnt->mnt_sb, &qname);
89 if (!dentry) { 88 if (!dentry) {
90 iput(inode); 89 iput(inode);
91 mntput(mnt);
92 return ERR_PTR(-ENOMEM); 90 return ERR_PTR(-ENOMEM);
93 } 91 }
94 d_instantiate(dentry, inode); 92 d_instantiate(dentry, inode);
@@ -97,7 +95,6 @@ slow:
97 if (d) { 95 if (d) {
98 d_delete(dentry); /* make sure ->d_prune() does nothing */ 96 d_delete(dentry); /* make sure ->d_prune() does nothing */
99 dput(dentry); 97 dput(dentry);
100 mntput(mnt);
101 cpu_relax(); 98 cpu_relax();
102 return ERR_PTR(-EAGAIN); 99 return ERR_PTR(-EAGAIN);
103 } 100 }