diff options
Diffstat (limited to 'fs/9p/vfs_super.c')
-rw-r--r-- | fs/9p/vfs_super.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/fs/9p/vfs_super.c b/fs/9p/vfs_super.c index 2c4fa75be025..cdf787ee08de 100644 --- a/fs/9p/vfs_super.c +++ b/fs/9p/vfs_super.c | |||
@@ -146,7 +146,6 @@ static struct super_block *v9fs_get_sb(struct file_system_type | |||
146 | inode->i_gid = gid; | 146 | inode->i_gid = gid; |
147 | 147 | ||
148 | root = d_alloc_root(inode); | 148 | root = d_alloc_root(inode); |
149 | |||
150 | if (!root) { | 149 | if (!root) { |
151 | retval = -ENOMEM; | 150 | retval = -ENOMEM; |
152 | goto put_back_sb; | 151 | goto put_back_sb; |
@@ -157,16 +156,22 @@ static struct super_block *v9fs_get_sb(struct file_system_type | |||
157 | stat_result = v9fs_t_stat(v9ses, newfid, &fcall); | 156 | stat_result = v9fs_t_stat(v9ses, newfid, &fcall); |
158 | if (stat_result < 0) { | 157 | if (stat_result < 0) { |
159 | dprintk(DEBUG_ERROR, "stat error\n"); | 158 | dprintk(DEBUG_ERROR, "stat error\n"); |
159 | kfree(fcall); | ||
160 | v9fs_t_clunk(v9ses, newfid); | 160 | v9fs_t_clunk(v9ses, newfid); |
161 | v9fs_put_idpool(newfid, &v9ses->fidpool); | ||
162 | } else { | 161 | } else { |
163 | /* Setup the Root Inode */ | 162 | /* Setup the Root Inode */ |
164 | root_fid = v9fs_fid_create(root, v9ses, newfid, 0); | 163 | root_fid = v9fs_fid_create(v9ses, newfid); |
165 | if (root_fid == NULL) { | 164 | if (root_fid == NULL) { |
166 | retval = -ENOMEM; | 165 | retval = -ENOMEM; |
167 | goto put_back_sb; | 166 | goto put_back_sb; |
168 | } | 167 | } |
169 | 168 | ||
169 | retval = v9fs_fid_insert(root_fid, root); | ||
170 | if (retval < 0) { | ||
171 | kfree(fcall); | ||
172 | goto put_back_sb; | ||
173 | } | ||
174 | |||
170 | root_fid->qid = fcall->params.rstat.stat.qid; | 175 | root_fid->qid = fcall->params.rstat.stat.qid; |
171 | root->d_inode->i_ino = | 176 | root->d_inode->i_ino = |
172 | v9fs_qid2ino(&fcall->params.rstat.stat.qid); | 177 | v9fs_qid2ino(&fcall->params.rstat.stat.qid); |