summaryrefslogtreecommitdiffstats
path: root/fs/gfs2/super.c
diff options
context:
space:
mode:
authorBob Peterson2019-04-05 05:41:38 +0200
committerAndreas Gruenbacher2019-05-07 23:39:14 +0200
commit73118ca8baf78dddd1f9c8ac67c1d80b47d9830e (patch)
tree72c0d2a327c8bace37ce5984f39d971ab5768594 /fs/gfs2/super.c
parentgfs2: Fix occasional glock use-after-free (diff)
downloadkernel-qcow2-linux-73118ca8baf78dddd1f9c8ac67c1d80b47d9830e.tar.gz
kernel-qcow2-linux-73118ca8baf78dddd1f9c8ac67c1d80b47d9830e.tar.xz
kernel-qcow2-linux-73118ca8baf78dddd1f9c8ac67c1d80b47d9830e.zip
gfs2: Replace gl_revokes with a GLF flag
The gl_revokes value determines how many outstanding revokes a glock has on the superblock revokes list; this is used to avoid unnecessary log flushes. However, gl_revokes is only ever tested for being zero, and it's only decremented in revoke_lo_after_commit, which removes all revokes from the list, so we know that the gl_revoke values of all the glocks on the list will reach zero. Therefore, we can replace gl_revokes with a bit flag. This saves an atomic counter in struct gfs2_glock. Signed-off-by: Bob Peterson <rpeterso@redhat.com> Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Diffstat (limited to 'fs/gfs2/super.c')
-rw-r--r--fs/gfs2/super.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c
index 7b8d2306b3d3..2a7692d70394 100644
--- a/fs/gfs2/super.c
+++ b/fs/gfs2/super.c
@@ -1474,7 +1474,7 @@ static void gfs2_final_release_pages(struct gfs2_inode *ip)
truncate_inode_pages(gfs2_glock2aspace(ip->i_gl), 0);
truncate_inode_pages(&inode->i_data, 0);
- if (atomic_read(&gl->gl_revokes) == 0) {
+ if (!test_bit(GLF_REVOKES, &gl->gl_flags)) {
clear_bit(GLF_LFLUSH, &gl->gl_flags);
clear_bit(GLF_DIRTY, &gl->gl_flags);
}