diff options
author | Steven Whitehouse <swhiteho@redhat.com> | 2006-05-16 13:37:11 -0400 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2006-05-16 13:37:11 -0400 |
commit | 64c14ea73b58e2c3759682d67eeb00d088355f08 (patch) | |
tree | 69f6adfd67fd7d597f1c16d1dff8ad2b8e055df3 /fs/gfs2/inode.c | |
parent | b9cb981310bc22f165726e99385c2d85196e2f41 (diff) |
[GFS2] Fix ref count bug that used to bite us on umount
The ref count of certain glock's got elevated too far during unlink
which caused umount to fail. This fixes it.
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/inode.c')
-rw-r--r-- | fs/gfs2/inode.c | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c index 5522fa747297..5bc9542c7fcb 100644 --- a/fs/gfs2/inode.c +++ b/fs/gfs2/inode.c | |||
@@ -297,19 +297,13 @@ static int inode_create(struct gfs2_glock *i_gl, const struct gfs2_inum *inum, | |||
297 | if (!ip) | 297 | if (!ip) |
298 | return -ENOMEM; | 298 | return -ENOMEM; |
299 | memset(ip, 0, sizeof(struct gfs2_inode)); | 299 | memset(ip, 0, sizeof(struct gfs2_inode)); |
300 | |||
301 | ip->i_num = *inum; | 300 | ip->i_num = *inum; |
302 | |||
303 | atomic_set(&ip->i_count, 1); | 301 | atomic_set(&ip->i_count, 1); |
304 | |||
305 | ip->i_vn = i_gl->gl_vn - 1; | 302 | ip->i_vn = i_gl->gl_vn - 1; |
306 | |||
307 | ip->i_gl = i_gl; | 303 | ip->i_gl = i_gl; |
308 | ip->i_sbd = sdp; | 304 | ip->i_sbd = sdp; |
309 | |||
310 | spin_lock_init(&ip->i_spin); | 305 | spin_lock_init(&ip->i_spin); |
311 | init_rwsem(&ip->i_rw_mutex); | 306 | init_rwsem(&ip->i_rw_mutex); |
312 | |||
313 | ip->i_greedy = gfs2_tune_get(sdp, gt_greedy_default); | 307 | ip->i_greedy = gfs2_tune_get(sdp, gt_greedy_default); |
314 | 308 | ||
315 | if (need_lock) { | 309 | if (need_lock) { |
@@ -318,27 +312,23 @@ static int inode_create(struct gfs2_glock *i_gl, const struct gfs2_inum *inum, | |||
318 | &ip->i_iopen_gh); | 312 | &ip->i_iopen_gh); |
319 | if (error) | 313 | if (error) |
320 | goto fail; | 314 | goto fail; |
321 | } | ||
322 | 315 | ||
323 | spin_lock(&io_gl->gl_spin); | 316 | spin_lock(&io_gl->gl_spin); |
324 | gfs2_glock_hold(i_gl); | 317 | gfs2_glock_hold(i_gl); |
325 | io_gl->gl_object = i_gl; | 318 | io_gl->gl_object = i_gl; |
326 | spin_unlock(&io_gl->gl_spin); | 319 | spin_unlock(&io_gl->gl_spin); |
320 | } | ||
327 | 321 | ||
328 | gfs2_glock_hold(i_gl); | 322 | gfs2_glock_hold(i_gl); |
329 | i_gl->gl_object = ip; | 323 | i_gl->gl_object = ip; |
330 | |||
331 | atomic_inc(&sdp->sd_inode_count); | 324 | atomic_inc(&sdp->sd_inode_count); |
332 | |||
333 | *ipp = ip; | 325 | *ipp = ip; |
334 | |||
335 | return 0; | 326 | return 0; |
336 | 327 | ||
337 | fail: | 328 | fail: |
338 | gfs2_meta_cache_flush(ip); | 329 | gfs2_meta_cache_flush(ip); |
339 | kmem_cache_free(gfs2_inode_cachep, ip); | 330 | kmem_cache_free(gfs2_inode_cachep, ip); |
340 | *ipp = NULL; | 331 | *ipp = NULL; |
341 | |||
342 | return error; | 332 | return error; |
343 | } | 333 | } |
344 | 334 | ||