gfs2: Initialize iopen glock holder for new inodes
authorAndreas Gruenbacher <agruenba@redhat.com>
Fri, 17 Jun 2016 12:22:15 +0000 (07:22 -0500)
committerBob Peterson <rpeterso@redhat.com>
Fri, 17 Jun 2016 13:35:03 +0000 (08:35 -0500)
In gfs2_init_inode_once, initialize inode->i_iopen_gh.gh_gl to NULL:
otherwise, when gfs2_inode_lookup fails, the iopen glock holder can
remain unset and iget_failed can end up accessing random memory.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
fs/gfs2/main.c

index f99f8e94de3f3a65ff53839a282a160fa2ac41b2..615f67581cc2e21c75347067946ecd61a48dabd0 100644 (file)
@@ -45,6 +45,7 @@ static void gfs2_init_inode_once(void *foo)
        memset(&ip->i_res, 0, sizeof(ip->i_res));
        RB_CLEAR_NODE(&ip->i_res.rs_node);
        ip->i_hash_cache = NULL;
+       ip->i_iopen_gh.gh_gl = NULL;
 }
 
 static void gfs2_init_glock_once(void *foo)