diff options
| -rw-r--r-- | fs/gfs2/inode.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c index b5612cbb62a5..f03afd9c44bc 100644 --- a/fs/gfs2/inode.c +++ b/fs/gfs2/inode.c | |||
| @@ -169,7 +169,7 @@ struct inode *gfs2_inode_lookup(struct super_block *sb, | |||
| 169 | { | 169 | { |
| 170 | struct inode *inode; | 170 | struct inode *inode; |
| 171 | struct gfs2_inode *ip; | 171 | struct gfs2_inode *ip; |
| 172 | struct gfs2_glock *io_gl; | 172 | struct gfs2_glock *io_gl = NULL; |
| 173 | int error; | 173 | int error; |
| 174 | 174 | ||
| 175 | inode = gfs2_iget(sb, no_addr); | 175 | inode = gfs2_iget(sb, no_addr); |
| @@ -198,6 +198,7 @@ struct inode *gfs2_inode_lookup(struct super_block *sb, | |||
| 198 | ip->i_iopen_gh.gh_gl->gl_object = ip; | 198 | ip->i_iopen_gh.gh_gl->gl_object = ip; |
| 199 | 199 | ||
| 200 | gfs2_glock_put(io_gl); | 200 | gfs2_glock_put(io_gl); |
| 201 | io_gl = NULL; | ||
| 201 | 202 | ||
| 202 | if ((type == DT_UNKNOWN) && (no_formal_ino == 0)) | 203 | if ((type == DT_UNKNOWN) && (no_formal_ino == 0)) |
| 203 | goto gfs2_nfsbypass; | 204 | goto gfs2_nfsbypass; |
| @@ -228,7 +229,8 @@ gfs2_nfsbypass: | |||
| 228 | fail_glock: | 229 | fail_glock: |
| 229 | gfs2_glock_dq(&ip->i_iopen_gh); | 230 | gfs2_glock_dq(&ip->i_iopen_gh); |
| 230 | fail_iopen: | 231 | fail_iopen: |
| 231 | gfs2_glock_put(io_gl); | 232 | if (io_gl) |
| 233 | gfs2_glock_put(io_gl); | ||
| 232 | fail_put: | 234 | fail_put: |
| 233 | if (inode->i_state & I_NEW) | 235 | if (inode->i_state & I_NEW) |
| 234 | ip->i_gl->gl_object = NULL; | 236 | ip->i_gl->gl_object = NULL; |
| @@ -256,7 +258,7 @@ void gfs2_process_unlinked_inode(struct super_block *sb, u64 no_addr) | |||
| 256 | { | 258 | { |
| 257 | struct gfs2_sbd *sdp; | 259 | struct gfs2_sbd *sdp; |
| 258 | struct gfs2_inode *ip; | 260 | struct gfs2_inode *ip; |
| 259 | struct gfs2_glock *io_gl; | 261 | struct gfs2_glock *io_gl = NULL; |
| 260 | int error; | 262 | int error; |
| 261 | struct gfs2_holder gh; | 263 | struct gfs2_holder gh; |
| 262 | struct inode *inode; | 264 | struct inode *inode; |
| @@ -293,6 +295,7 @@ void gfs2_process_unlinked_inode(struct super_block *sb, u64 no_addr) | |||
| 293 | 295 | ||
| 294 | ip->i_iopen_gh.gh_gl->gl_object = ip; | 296 | ip->i_iopen_gh.gh_gl->gl_object = ip; |
| 295 | gfs2_glock_put(io_gl); | 297 | gfs2_glock_put(io_gl); |
| 298 | io_gl = NULL; | ||
| 296 | 299 | ||
| 297 | inode->i_mode = DT2IF(DT_UNKNOWN); | 300 | inode->i_mode = DT2IF(DT_UNKNOWN); |
| 298 | 301 | ||
| @@ -319,7 +322,8 @@ void gfs2_process_unlinked_inode(struct super_block *sb, u64 no_addr) | |||
| 319 | fail_glock: | 322 | fail_glock: |
| 320 | gfs2_glock_dq(&ip->i_iopen_gh); | 323 | gfs2_glock_dq(&ip->i_iopen_gh); |
| 321 | fail_iopen: | 324 | fail_iopen: |
| 322 | gfs2_glock_put(io_gl); | 325 | if (io_gl) |
| 326 | gfs2_glock_put(io_gl); | ||
| 323 | fail_put: | 327 | fail_put: |
| 324 | ip->i_gl->gl_object = NULL; | 328 | ip->i_gl->gl_object = NULL; |
| 325 | gfs2_glock_put(ip->i_gl); | 329 | gfs2_glock_put(ip->i_gl); |
