From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bob Peterson Date: Thu, 22 Oct 2015 14:30:10 -0500 Subject: [Cluster-devel] [GFS2 PATCH v3 02/14] GFS2: Allow fail_gunlock3 to set the free_vfs_inode bit In-Reply-To: <1445542222-30672-1-git-send-email-rpeterso@redhat.com> References: <1445542222-30672-1-git-send-email-rpeterso@redhat.com> Message-ID: <1445542222-30672-3-git-send-email-rpeterso@redhat.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit This patch changes a failure case in function gfs2_create_inode. In some error paths, it jumps to label fail_gunlock3, which fails to set the free_vfs_inode flag. This, in turn, prevents the code from setting the GIF_FREE_VFS_INODE inode flag. That, in turn, allow the code to mistakenly unlink the dinode and not ever delete its data blocks. Signed-off-by: Bob Peterson --- fs/gfs2/inode.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c index 063fdfc..c56edb8 100644 --- a/fs/gfs2/inode.c +++ b/fs/gfs2/inode.c @@ -766,11 +766,8 @@ static int gfs2_create_inode(struct inode *dir, struct dentry *dentry, return error; fail_gunlock3: - gfs2_glock_dq_uninit(ghs + 1); - if (ip->i_gl) - gfs2_glock_put(ip->i_gl); - goto fail_gunlock; - + if (ip->i_iopen_gh.gh_gl) /* if holder is linked to the glock */ + gfs2_glock_put(ip->i_iopen_gh.gh_gl); fail_gunlock2: gfs2_glock_dq_uninit(ghs + 1); fail_free_inode: -- 2.4.3