Skip to content

Commit ba37a31

Browse files
author
Andreas Gruenbacher
committed
gfs2: Don't reread inodes unnecessarily
JIRA: https://issues.redhat.com/browse/RHEL-88093 Upstream Status: https://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2.git 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> (cherry picked from commit 0d735a3bac90ac940ed6fa43356e8f58ed44bc1e)
1 parent 8eb4f09 commit ba37a31

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

fs/gfs2/inode.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -760,6 +760,7 @@ static int gfs2_create_inode(struct inode *dir, struct dentry *dentry,
760760
error = gfs2_glock_nq_init(ip->i_gl, LM_ST_EXCLUSIVE, GL_SKIP, &gh);
761761
if (error)
762762
goto fail_gunlock3;
763+
clear_bit(GLF_INSTANTIATE_NEEDED, &ip->i_gl->gl_flags);
763764

764765
error = gfs2_trans_begin(sdp, blocks, 0);
765766
if (error)

0 commit comments

Comments
 (0)