aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAbhishek Kulkarni <adkulkar@umail.iu.edu>2009-07-19 15:41:52 -0400
committerEric Van Hensbergen <ericvh@strongmad.austin.ibm.com>2009-08-17 17:27:57 -0400
commit1b5ab3e86712b6be38ebbe0d821387c1d8f91d7c (patch)
tree8c7cc3d58d6bd8f62398de5f963966b7bf58abb9
parent4f4038328da5eb9cc237b51d3fe68138fd3fea14 (diff)
9p: Fix possible regressions when ->get_sb fails.
->get_sb can fail causing some badness. this patch fixes * clear sb->fs_s_info in kill_sb. * deactivate_locked_super() calls kill_sb (v9fs_kill_super) which closes the destroys the client, clunks all its fids and closes the v9fs session. Attempting to do it twice will cause an oops. Signed-off-by: Abhishek Kulkarni <adkulkar@umail.iu.edu> Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
-rw-r--r--fs/9p/vfs_super.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/fs/9p/vfs_super.c b/fs/9p/vfs_super.c
index a9d7d08cfbe8..2495af4ad9a6 100644
--- a/fs/9p/vfs_super.c
+++ b/fs/9p/vfs_super.c
@@ -120,7 +120,6 @@ static int v9fs_get_sb(struct file_system_type *fs_type, int flags,
120 120
121 P9_DPRINTK(P9_DEBUG_VFS, " \n"); 121 P9_DPRINTK(P9_DEBUG_VFS, " \n");
122 122
123 st = NULL;
124 v9ses = kzalloc(sizeof(struct v9fs_session_info), GFP_KERNEL); 123 v9ses = kzalloc(sizeof(struct v9fs_session_info), GFP_KERNEL);
125 if (!v9ses) 124 if (!v9ses)
126 return -ENOMEM; 125 return -ENOMEM;
@@ -173,10 +172,8 @@ P9_DPRINTK(P9_DEBUG_VFS, " simple set mount, return 0\n");
173 simple_set_mnt(mnt, sb); 172 simple_set_mnt(mnt, sb);
174 return 0; 173 return 0;
175 174
176release_sb:
177 deactivate_locked_super(sb);
178
179free_stat: 175free_stat:
176 p9stat_free(st);
180 kfree(st); 177 kfree(st);
181 178
182clunk_fid: 179clunk_fid:
@@ -185,7 +182,12 @@ clunk_fid:
185close_session: 182close_session:
186 v9fs_session_close(v9ses); 183 v9fs_session_close(v9ses);
187 kfree(v9ses); 184 kfree(v9ses);
185 return retval;
188 186
187release_sb:
188 p9stat_free(st);
189 kfree(st);
190 deactivate_locked_super(sb);
189 return retval; 191 return retval;
190} 192}
191 193
@@ -207,6 +209,7 @@ static void v9fs_kill_super(struct super_block *s)
207 209
208 v9fs_session_close(v9ses); 210 v9fs_session_close(v9ses);
209 kfree(v9ses); 211 kfree(v9ses);
212 s->s_fs_info = NULL;
210 P9_DPRINTK(P9_DEBUG_VFS, "exiting kill_super\n"); 213 P9_DPRINTK(P9_DEBUG_VFS, "exiting kill_super\n");
211} 214}
212 215