diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-05-14 22:30:13 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-05-14 22:30:51 -0400 |
| commit | 8f40f672e6bb071812f61bfbd30efc3fc1263ad1 (patch) | |
| tree | 8dcdbbb7adc68647267794c4e3a4686afd94ad65 /fs/9p/vfs_super.c | |
| parent | 8978a318837d7acefca82645017c0534aeba5a36 (diff) | |
| parent | 887b3ece65be7b643dfdae0d433c91a26a3f437d (diff) | |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ericvh/v9fs
* 'for-linus' of ssh://master.kernel.org/pub/scm/linux/kernel/git/ericvh/v9fs:
9p: fix error path during early mount
9p: make cryptic unknown error from server less scary
9p: fix flags length in net
9p: Correct fidpool creation failure in p9_client_create
9p: use struct mutex instead of struct semaphore
9p: propagate parse_option changes to client and transports
fs/9p/v9fs.c (v9fs_parse_options): Handle kstrdup and match_strdup failure.
9p: Documentation updates
add match_strlcpy() us it to make v9fs make uname and remotename parsing more robust
Diffstat (limited to 'fs/9p/vfs_super.c')
| -rw-r--r-- | fs/9p/vfs_super.c | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/fs/9p/vfs_super.c b/fs/9p/vfs_super.c index a452ac67fc94..bf59c3960494 100644 --- a/fs/9p/vfs_super.c +++ b/fs/9p/vfs_super.c | |||
| @@ -75,6 +75,7 @@ static int v9fs_set_super(struct super_block *s, void *data) | |||
| 75 | * v9fs_fill_super - populate superblock with info | 75 | * v9fs_fill_super - populate superblock with info |
| 76 | * @sb: superblock | 76 | * @sb: superblock |
| 77 | * @v9ses: session information | 77 | * @v9ses: session information |
| 78 | * @flags: flags propagated from v9fs_get_sb() | ||
| 78 | * | 79 | * |
| 79 | */ | 80 | */ |
| 80 | 81 | ||
| @@ -127,29 +128,26 @@ static int v9fs_get_sb(struct file_system_type *fs_type, int flags, | |||
| 127 | fid = v9fs_session_init(v9ses, dev_name, data); | 128 | fid = v9fs_session_init(v9ses, dev_name, data); |
| 128 | if (IS_ERR(fid)) { | 129 | if (IS_ERR(fid)) { |
| 129 | retval = PTR_ERR(fid); | 130 | retval = PTR_ERR(fid); |
| 130 | fid = NULL; | 131 | goto close_session; |
| 131 | kfree(v9ses); | ||
| 132 | v9ses = NULL; | ||
| 133 | goto error; | ||
| 134 | } | 132 | } |
| 135 | 133 | ||
| 136 | st = p9_client_stat(fid); | 134 | st = p9_client_stat(fid); |
| 137 | if (IS_ERR(st)) { | 135 | if (IS_ERR(st)) { |
| 138 | retval = PTR_ERR(st); | 136 | retval = PTR_ERR(st); |
| 139 | goto error; | 137 | goto clunk_fid; |
| 140 | } | 138 | } |
| 141 | 139 | ||
| 142 | sb = sget(fs_type, NULL, v9fs_set_super, v9ses); | 140 | sb = sget(fs_type, NULL, v9fs_set_super, v9ses); |
| 143 | if (IS_ERR(sb)) { | 141 | if (IS_ERR(sb)) { |
| 144 | retval = PTR_ERR(sb); | 142 | retval = PTR_ERR(sb); |
| 145 | goto error; | 143 | goto free_stat; |
| 146 | } | 144 | } |
| 147 | v9fs_fill_super(sb, v9ses, flags); | 145 | v9fs_fill_super(sb, v9ses, flags); |
| 148 | 146 | ||
| 149 | inode = v9fs_get_inode(sb, S_IFDIR | mode); | 147 | inode = v9fs_get_inode(sb, S_IFDIR | mode); |
| 150 | if (IS_ERR(inode)) { | 148 | if (IS_ERR(inode)) { |
| 151 | retval = PTR_ERR(inode); | 149 | retval = PTR_ERR(inode); |
| 152 | goto error; | 150 | goto release_sb; |
| 153 | } | 151 | } |
| 154 | 152 | ||
| 155 | inode->i_uid = uid; | 153 | inode->i_uid = uid; |
| @@ -158,7 +156,7 @@ static int v9fs_get_sb(struct file_system_type *fs_type, int flags, | |||
| 158 | root = d_alloc_root(inode); | 156 | root = d_alloc_root(inode); |
| 159 | if (!root) { | 157 | if (!root) { |
| 160 | retval = -ENOMEM; | 158 | retval = -ENOMEM; |
| 161 | goto error; | 159 | goto release_sb; |
| 162 | } | 160 | } |
| 163 | 161 | ||
| 164 | sb->s_root = root; | 162 | sb->s_root = root; |
| @@ -169,21 +167,22 @@ static int v9fs_get_sb(struct file_system_type *fs_type, int flags, | |||
| 169 | 167 | ||
| 170 | return simple_set_mnt(mnt, sb); | 168 | return simple_set_mnt(mnt, sb); |
| 171 | 169 | ||
| 172 | error: | 170 | release_sb: |
| 173 | kfree(st); | ||
| 174 | if (fid) | ||
| 175 | p9_client_clunk(fid); | ||
| 176 | |||
| 177 | if (v9ses) { | ||
| 178 | v9fs_session_close(v9ses); | ||
| 179 | kfree(v9ses); | ||
| 180 | } | ||
| 181 | |||
| 182 | if (sb) { | 171 | if (sb) { |
| 183 | up_write(&sb->s_umount); | 172 | up_write(&sb->s_umount); |
| 184 | deactivate_super(sb); | 173 | deactivate_super(sb); |
| 185 | } | 174 | } |
| 186 | 175 | ||
| 176 | free_stat: | ||
| 177 | kfree(st); | ||
| 178 | |||
| 179 | clunk_fid: | ||
| 180 | p9_client_clunk(fid); | ||
| 181 | |||
| 182 | close_session: | ||
| 183 | v9fs_session_close(v9ses); | ||
| 184 | kfree(v9ses); | ||
| 185 | |||
| 187 | return retval; | 186 | return retval; |
| 188 | } | 187 | } |
| 189 | 188 | ||
