diff options
author | Andreas Gruenbacher <agruenba@redhat.com> | 2017-06-30 15:16:46 +0200 |
---|---|---|
committer | Bob Peterson <rpeterso@redhat.com> | 2017-07-05 14:21:07 +0200 |
commit | e0b62e21b71bbe6d1015fe3e891cd9f50d04e660 (patch) | |
tree | c96f76569f65d182f60486d7f8ac5bfb5d23a3f3 /fs/gfs2/inode.c | |
parent | gfs2: Clean up glock work enqueuing (diff) | |
download | linux-e0b62e21b71bbe6d1015fe3e891cd9f50d04e660.tar.xz linux-e0b62e21b71bbe6d1015fe3e891cd9f50d04e660.zip |
gfs2: gfs2_create_inode: Keep glock across iput
On failure, keep the inode glock across the final iput of the new inode
so that gfs2_evict_inode doesn't have to re-acquire the glock. That
way, gfs2_evict_inode won't need to revalidate the block type.
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Diffstat (limited to 'fs/gfs2/inode.c')
-rw-r--r-- | fs/gfs2/inode.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c index 50108fa724c7..acca501f8110 100644 --- a/fs/gfs2/inode.c +++ b/fs/gfs2/inode.c @@ -608,6 +608,7 @@ static int gfs2_create_inode(struct inode *dir, struct dentry *dentry, error = gfs2_glock_nq_init(dip->i_gl, LM_ST_EXCLUSIVE, 0, ghs); if (error) goto fail; + gfs2_holder_mark_uninitialized(ghs + 1); error = create_ok(dip, name, mode); if (error) @@ -779,7 +780,6 @@ fail_gunlock3: 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) gfs2_glock_put(ip->i_gl); @@ -800,6 +800,8 @@ fail_gunlock: &GFS2_I(inode)->i_flags); iput(inode); } + if (gfs2_holder_initialized(ghs + 1)) + gfs2_glock_dq_uninit(ghs + 1); fail: return error; } |