Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 7ef3f5e

Browse files
committedMay 21, 2025
gfs2: minor evict fix
jira NONE_AUTOMATION Rebuild_History Non-Buildable kernel-5.14.0-570.12.1.el9_6 commit-author Andreas Gruenbacher <[email protected]> commit e9e38ed 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]> (cherry picked from commit e9e38ed) Signed-off-by: Jonathan Maple <[email protected]>
1 parent f33ca5f commit 7ef3f5e

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed
 

‎fs/gfs2/super.c

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1353,12 +1353,8 @@ static enum evict_behavior evict_should_delete(struct inode *inode,
13531353

13541354
/* Must not read inode block until block type has been verified */
13551355
ret = gfs2_glock_nq_init(ip->i_gl, LM_ST_EXCLUSIVE, GL_SKIP, gh);
1356-
if (unlikely(ret)) {
1357-
glock_clear_object(ip->i_iopen_gh.gh_gl, ip);
1358-
ip->i_iopen_gh.gh_flags |= GL_NOCACHE;
1359-
gfs2_glock_dq_uninit(&ip->i_iopen_gh);
1356+
if (unlikely(ret))
13601357
return EVICT_SHOULD_DEFER_DELETE;
1361-
}
13621358

13631359
if (gfs2_inode_already_deleted(ip->i_gl, ip->i_no_formal_ino))
13641360
return EVICT_SHOULD_SKIP_DELETE;
@@ -1380,15 +1376,8 @@ static enum evict_behavior evict_should_delete(struct inode *inode,
13801376

13811377
should_delete:
13821378
if (gfs2_holder_initialized(&ip->i_iopen_gh) &&
1383-
test_bit(HIF_HOLDER, &ip->i_iopen_gh.gh_iflags)) {
1384-
enum evict_behavior behavior =
1385-
gfs2_upgrade_iopen_glock(inode);
1386-
1387-
if (behavior != EVICT_SHOULD_DELETE) {
1388-
gfs2_holder_uninit(&ip->i_iopen_gh);
1389-
return behavior;
1390-
}
1391-
}
1379+
test_bit(HIF_HOLDER, &ip->i_iopen_gh.gh_iflags))
1380+
return gfs2_upgrade_iopen_glock(inode);
13921381
return EVICT_SHOULD_DELETE;
13931382
}
13941383

0 commit comments

Comments
 (0)
Please sign in to comment.