Skip to content

Commit e9e38ed

Browse files
author
Andreas Gruenbacher
committed
gfs2: minor evict fix
In evict_should_delete(), when gfs2_upgrade_iopen_glock() fails, we detach the iopen glock from the inode without calling glock_clear_object(). This leads to a warning in glock_set_object() when the same inode is recreated and the glock is reused. Fix that by only detaching the iopen glock in gfs2_evict_inode(). In addition, remove the dequeue code from evict_should_delete(); we already perform a conditional dequeue in gfs2_evict_inode(). Signed-off-by: Andreas Gruenbacher <[email protected]>
1 parent 9136cad commit e9e38ed

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed

Diff for: fs/gfs2/super.c

+3-14
Original file line numberDiff line numberDiff line change
@@ -1339,12 +1339,8 @@ static enum evict_behavior evict_should_delete(struct inode *inode,
13391339

13401340
/* Must not read inode block until block type has been verified */
13411341
ret = gfs2_glock_nq_init(ip->i_gl, LM_ST_EXCLUSIVE, GL_SKIP, gh);
1342-
if (unlikely(ret)) {
1343-
glock_clear_object(ip->i_iopen_gh.gh_gl, ip);
1344-
ip->i_iopen_gh.gh_flags |= GL_NOCACHE;
1345-
gfs2_glock_dq_uninit(&ip->i_iopen_gh);
1342+
if (unlikely(ret))
13461343
return EVICT_SHOULD_DEFER_DELETE;
1347-
}
13481344

13491345
if (gfs2_inode_already_deleted(ip->i_gl, ip->i_no_formal_ino))
13501346
return EVICT_SHOULD_SKIP_DELETE;
@@ -1364,15 +1360,8 @@ static enum evict_behavior evict_should_delete(struct inode *inode,
13641360

13651361
should_delete:
13661362
if (gfs2_holder_initialized(&ip->i_iopen_gh) &&
1367-
test_bit(HIF_HOLDER, &ip->i_iopen_gh.gh_iflags)) {
1368-
enum evict_behavior behavior =
1369-
gfs2_upgrade_iopen_glock(inode);
1370-
1371-
if (behavior != EVICT_SHOULD_DELETE) {
1372-
gfs2_holder_uninit(&ip->i_iopen_gh);
1373-
return behavior;
1374-
}
1375-
}
1363+
test_bit(HIF_HOLDER, &ip->i_iopen_gh.gh_iflags))
1364+
return gfs2_upgrade_iopen_glock(inode);
13761365
return EVICT_SHOULD_DELETE;
13771366
}
13781367

0 commit comments

Comments
 (0)