Skip to content

Commit bc6a159

Browse files
committed
gfs2: Replace GIF_DEFER_DELETE with GLF_DEFER_DELETE
jira LE-12345 Rebuild_History Non-Buildable kernel-5.14.0-570.12.1.el9_6 commit-author Andreas Gruenbacher <agruenba@redhat.com> commit 3774f53 Having this flag attached to the iopen glock instead of the inode is much simpler; it eliminates a protential weird race in gfs2_try_evict(). Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com> (cherry picked from commit 3774f53) Signed-off-by: Jonathan Maple <jmaple@ciq.com>
1 parent 51bdb8b commit bc6a159

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

fs/gfs2/glock.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -993,15 +993,15 @@ static void gfs2_try_evict(struct gfs2_glock *gl)
993993
}
994994
}
995995
if (ip) {
996-
set_bit(GIF_DEFER_DELETE, &ip->i_flags);
996+
set_bit(GLF_DEFER_DELETE, &gl->gl_flags);
997997
d_prune_aliases(&ip->i_inode);
998998
iput(&ip->i_inode);
999+
clear_bit(GLF_DEFER_DELETE, &gl->gl_flags);
9991000

10001001
/* If the inode was evicted, gl->gl_object will now be NULL. */
10011002
spin_lock(&gl->gl_lockref.lock);
10021003
ip = gl->gl_object;
10031004
if (ip) {
1004-
clear_bit(GIF_DEFER_DELETE, &ip->i_flags);
10051005
if (!igrab(&ip->i_inode))
10061006
ip = NULL;
10071007
}
@@ -2360,6 +2360,8 @@ static const char *gflags2str(char *buf, const struct gfs2_glock *gl)
23602360
*p++ = 'e';
23612361
if (test_bit(GLF_VERIFY_DELETE, gflags))
23622362
*p++ = 'E';
2363+
if (test_bit(GLF_DEFER_DELETE, gflags))
2364+
*p++ = 's';
23632365
*p = 0;
23642366
return buf;
23652367
}

fs/gfs2/incore.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,7 @@ enum {
331331
GLF_TRY_TO_EVICT = 17, /* iopen glocks only */
332332
GLF_VERIFY_DELETE = 18, /* iopen glocks only */
333333
GLF_PENDING_REPLY = 19,
334+
GLF_DEFER_DELETE = 20, /* iopen glocks only */
334335
};
335336

336337
struct gfs2_glock {
@@ -377,7 +378,6 @@ enum {
377378
GIF_SW_PAGED = 3,
378379
GIF_FREE_VFS_INODE = 5,
379380
GIF_GLOP_PENDING = 6,
380-
GIF_DEFER_DELETE = 7,
381381
};
382382

383383
struct gfs2_inode {

fs/gfs2/super.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1343,7 +1343,8 @@ static enum evict_behavior evict_should_delete(struct inode *inode,
13431343
if (unlikely(test_bit(GIF_ALLOC_FAILED, &ip->i_flags)))
13441344
goto should_delete;
13451345

1346-
if (test_bit(GIF_DEFER_DELETE, &ip->i_flags))
1346+
if (gfs2_holder_initialized(&ip->i_iopen_gh) &&
1347+
test_bit(GLF_DEFER_DELETE, &ip->i_iopen_gh.gh_gl->gl_flags))
13471348
return EVICT_SHOULD_DEFER_DELETE;
13481349

13491350
/* Deletes should never happen under memory pressure anymore. */

fs/gfs2/trace_gfs2.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@
6464
{(1UL << GLF_INSTANTIATE_NEEDED), "n" }, \
6565
{(1UL << GLF_INSTANTIATE_IN_PROG), "N" }, \
6666
{(1UL << GLF_TRY_TO_EVICT), "e" }, \
67-
{(1UL << GLF_VERIFY_DELETE), "E" })
67+
{(1UL << GLF_VERIFY_DELETE), "E" }, \
68+
{(1UL << GLF_DEFER_DELETE), "s" })
6869

6970
#ifndef NUMPTY
7071
#define NUMPTY

0 commit comments

Comments
 (0)