aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorBob Peterson <rpeterso@redhat.com>2013-05-29 11:51:52 -0400
committerSteven Whitehouse <swhiteho@redhat.com>2013-06-03 11:40:22 -0400
commita6a4d98b0124b5d3befe8b3a99f51f1b4fcc6dcf (patch)
treec9da72b651e1c06ac14804d661f1dfbf4e8df75a /fs
parente8830d8856e3ad61067dd46c05438b0d75a0441a (diff)
GFS2: Don't cache iopen glocks
This patch makes GFS2 immediately reclaim/delete all iopen glocks as soon as they're dequeued. This allows deleters to get an EXclusive lock on iopen so files are deleted properly instead of being set as unlinked. Signed-off-by: Bob Peterson <rpeterso@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/gfs2/inode.c1
-rw-r--r--fs/gfs2/super.c6
2 files changed, 6 insertions, 1 deletions
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c
index 8833a4f264e3..62b484e4a9e4 100644
--- a/fs/gfs2/inode.c
+++ b/fs/gfs2/inode.c
@@ -189,6 +189,7 @@ struct inode *gfs2_inode_lookup(struct super_block *sb, unsigned int type,
189 return inode; 189 return inode;
190 190
191fail_refresh: 191fail_refresh:
192 ip->i_iopen_gh.gh_flags |= GL_NOCACHE;
192 ip->i_iopen_gh.gh_gl->gl_object = NULL; 193 ip->i_iopen_gh.gh_gl->gl_object = NULL;
193 gfs2_glock_dq_uninit(&ip->i_iopen_gh); 194 gfs2_glock_dq_uninit(&ip->i_iopen_gh);
194fail_iopen: 195fail_iopen:
diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c
index 917c8e1eb4ae..e5639dec66c4 100644
--- a/fs/gfs2/super.c
+++ b/fs/gfs2/super.c
@@ -1444,6 +1444,7 @@ static void gfs2_evict_inode(struct inode *inode)
1444 /* Must not read inode block until block type has been verified */ 1444 /* Must not read inode block until block type has been verified */
1445 error = gfs2_glock_nq_init(ip->i_gl, LM_ST_EXCLUSIVE, GL_SKIP, &gh); 1445 error = gfs2_glock_nq_init(ip->i_gl, LM_ST_EXCLUSIVE, GL_SKIP, &gh);
1446 if (unlikely(error)) { 1446 if (unlikely(error)) {
1447 ip->i_iopen_gh.gh_flags |= GL_NOCACHE;
1447 gfs2_glock_dq_uninit(&ip->i_iopen_gh); 1448 gfs2_glock_dq_uninit(&ip->i_iopen_gh);
1448 goto out; 1449 goto out;
1449 } 1450 }
@@ -1514,8 +1515,10 @@ out_unlock:
1514 if (gfs2_rs_active(ip->i_res)) 1515 if (gfs2_rs_active(ip->i_res))
1515 gfs2_rs_deltree(ip->i_res); 1516 gfs2_rs_deltree(ip->i_res);
1516 1517
1517 if (test_bit(HIF_HOLDER, &ip->i_iopen_gh.gh_iflags)) 1518 if (test_bit(HIF_HOLDER, &ip->i_iopen_gh.gh_iflags)) {
1519 ip->i_iopen_gh.gh_flags |= GL_NOCACHE;
1518 gfs2_glock_dq(&ip->i_iopen_gh); 1520 gfs2_glock_dq(&ip->i_iopen_gh);
1521 }
1519 gfs2_holder_uninit(&ip->i_iopen_gh); 1522 gfs2_holder_uninit(&ip->i_iopen_gh);
1520 gfs2_glock_dq_uninit(&gh); 1523 gfs2_glock_dq_uninit(&gh);
1521 if (error && error != GLR_TRYFAILED && error != -EROFS) 1524 if (error && error != GLR_TRYFAILED && error != -EROFS)
@@ -1534,6 +1537,7 @@ out:
1534 ip->i_gl = NULL; 1537 ip->i_gl = NULL;
1535 if (ip->i_iopen_gh.gh_gl) { 1538 if (ip->i_iopen_gh.gh_gl) {
1536 ip->i_iopen_gh.gh_gl->gl_object = NULL; 1539 ip->i_iopen_gh.gh_gl->gl_object = NULL;
1540 ip->i_iopen_gh.gh_flags |= GL_NOCACHE;
1537 gfs2_glock_dq_uninit(&ip->i_iopen_gh); 1541 gfs2_glock_dq_uninit(&ip->i_iopen_gh);
1538 } 1542 }
1539} 1543}