GFS2: Clear gl_object if gfs2_create_inode fails
authorBob Peterson <rpeterso@redhat.com>
Tue, 18 Jul 2017 17:26:07 +0000 (12:26 -0500)
committerBob Peterson <rpeterso@redhat.com>
Wed, 9 Aug 2017 14:36:26 +0000 (09:36 -0500)
commit9c1b28081f43c0f14ccbcad02a6e0f227c072da2
treebba27d1d2d13615052798da96a320dfcfd083aa3
parent4d7c18c7df89ef549f2de79b0faf873b49dea57a
GFS2: Clear gl_object if gfs2_create_inode fails

If function gfs2_create_inode fails after the inode has been
created (for example, if the inode_refresh fails for some reason)
the function was setting gl_object but never clearing it again.
The glocks are left pointing to a freed inode. This patch adds
the calls to clear gl_object in the appropriate error paths.

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