|
@@ -592,7 +592,7 @@ static int gfs2_create_inode(struct inode *dir, struct dentry *dentry,
|
|
|
struct inode *inode = NULL;
|
|
|
struct gfs2_inode *dip = GFS2_I(dir), *ip;
|
|
|
struct gfs2_sbd *sdp = GFS2_SB(&dip->i_inode);
|
|
|
- struct gfs2_glock *io_gl;
|
|
|
+ struct gfs2_glock *io_gl = NULL;
|
|
|
int error, free_vfs_inode = 1;
|
|
|
u32 aflags = 0;
|
|
|
unsigned blocks = 1;
|
|
@@ -729,6 +729,8 @@ static int gfs2_create_inode(struct inode *dir, struct dentry *dentry,
|
|
|
if (error)
|
|
|
goto fail_gunlock2;
|
|
|
|
|
|
+ BUG_ON(test_and_set_bit(GLF_INODE_CREATING, &io_gl->gl_flags));
|
|
|
+
|
|
|
error = gfs2_glock_nq_init(io_gl, LM_ST_SHARED, GL_EXACT, &ip->i_iopen_gh);
|
|
|
if (error)
|
|
|
goto fail_gunlock2;
|
|
@@ -771,12 +773,15 @@ static int gfs2_create_inode(struct inode *dir, struct dentry *dentry,
|
|
|
}
|
|
|
gfs2_glock_dq_uninit(ghs);
|
|
|
gfs2_glock_dq_uninit(ghs + 1);
|
|
|
+ clear_bit(GLF_INODE_CREATING, &io_gl->gl_flags);
|
|
|
return error;
|
|
|
|
|
|
fail_gunlock3:
|
|
|
gfs2_glock_dq_uninit(&ip->i_iopen_gh);
|
|
|
gfs2_glock_put(io_gl);
|
|
|
fail_gunlock2:
|
|
|
+ if (io_gl)
|
|
|
+ clear_bit(GLF_INODE_CREATING, &io_gl->gl_flags);
|
|
|
gfs2_glock_dq_uninit(ghs + 1);
|
|
|
fail_free_inode:
|
|
|
if (ip->i_gl)
|