summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruenba@redhat.com>2025-04-15 08:49:55 +0200
committerAndreas Gruenbacher <agruenba@redhat.com>2025-04-21 18:20:36 +0200
commit84a79ee68f8404c6b7e93f1784ce218c98a9f11b (patch)
tree12144d1ee47ba7a43b52bd4f1e768797ca03e069
parentaf4044fd0b77e915736527dd83011e46e6415f01 (diff)
gfs2: Don't reread inodes unnecessarily
In gfs2_create_inode(), we initialize the inode from scratch and then we write the result to disk. Clear the GLF_INSTANTIATE_NEEDED glock flag to indicate that the inode is up to date. Otherwise, the next time the inode glock is acquired, gfs2_instantiate() would reread the inode from disk, which isn't necessary. Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
-rw-r--r--fs/gfs2/inode.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c
index 9621680814b80..62ff09264f0fd 100644
--- a/fs/gfs2/inode.c
+++ b/fs/gfs2/inode.c
@@ -768,6 +768,7 @@ retry:
error = gfs2_glock_nq_init(ip->i_gl, LM_ST_EXCLUSIVE, GL_SKIP, &gh);
if (error)
goto fail_gunlock3;
+ clear_bit(GLF_INSTANTIATE_NEEDED, &ip->i_gl->gl_flags);
error = gfs2_trans_begin(sdp, blocks, 0);
if (error)