From: Bob Peterson Date: Fri, 17 Jun 2016 09:41:48 -0400 (EDT) Subject: [Cluster-devel] [PATCH] gfs2: Initialize iopen glock holder for new inodes In-Reply-To: <1466156441-28155-1-git-send-email-agruenba@redhat.com> References: <1466002012-12115-1-git-send-email-rpeterso@redhat.com> <1466156441-28155-1-git-send-email-agruenba@redhat.com> Message-ID: <1758711282.20821064.1466170908208.JavaMail.zimbra@redhat.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit ----- Original Message ----- | From: Bob Peterson | | 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. | | It turned out that patch "gfs2: Fix gfs2_lookup_by_inum lock inversion" made | gfs2_inode_lookup fail in this way more often, and we started to see this | kind | of failure. | | Signed-off-by: Andreas Gruenbacher | --- | fs/gfs2/main.c | 1 + | 1 file changed, 1 insertion(+) | | diff --git a/fs/gfs2/main.c b/fs/gfs2/main.c | index f99f8e9..615f675 100644 | --- a/fs/gfs2/main.c | +++ b/fs/gfs2/main.c | @@ -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) | -- | 2.5.5 | | Hi, Thanks. This is now applied to the for-next branch of the linux-gfs2 tree: https://git.kernel.org/cgit/linux/kernel/git/gfs2/linux-gfs2.git/commit/fs/gfs2?h=for-next&id=1e875f5a95a28b5286165db9fa832b0773657ddb Regards, Bob Peterson Red Hat File Systems