From: Steven Whitehouse <[email protected]> This fixes a bug in the ordering of operations in the error path of createi. Its not valid to do an iput() when holding the inode's glock since the iput() will (in this case) result in delete_inode() being called which needs to grab the lock itself. This was causing the recursive lock checking code to trigger. Signed-off-by: Steven Whitehouse <[email protected]> diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c index 3ef0f05..87505f7 100644 --- a/fs/gfs2/inode.c +++ b/fs/gfs2/inode.c @@ -857,7 +857,7 @@ static int gfs2_security_init(struct gfs2_inode *dip, struct gfs2_inode *ip) struct inode *gfs2_createi(struct gfs2_holder *ghs, const struct qstr *name, unsigned int mode, dev_t dev) { - struct inode *inode; + struct inode *inode = NULL; struct gfs2_inode *dip = ghs->gh_gl->gl_object; struct inode *dir = &dip->i_inode; struct gfs2_sbd *sdp = GFS2_SB(&dip->i_inode); @@ -900,28 +900,28 @@ struct inode *gfs2_createi(struct gfs2_holder *ghs, const struct qstr *name, error = gfs2_inode_refresh(GFS2_I(inode)); if (error) - goto fail_iput; + goto fail_gunlock2; error = gfs2_acl_create(dip, GFS2_I(inode)); if (error) - goto fail_iput; + goto fail_gunlock2; error = gfs2_security_init(dip, GFS2_I(inode)); if (error) - goto fail_iput; + goto fail_gunlock2; error = link_dinode(dip, name, GFS2_I(inode)); if (error) - goto fail_iput; + goto fail_gunlock2; if (!inode) return ERR_PTR(-ENOMEM); return inode; -fail_iput: - iput(inode); fail_gunlock2: gfs2_glock_dq_uninit(ghs + 1); + if (inode) + iput(inode); fail_gunlock: gfs2_glock_dq(ghs); fail: -- 1.5.1.2 - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
- Follow-Ups:
- References:
- [GFS2/DLM] Pre-pull Patch Posting
- From: [email protected]
- [PATCH] [GFS2] flush the glock completely in inode_go_sync
- From: [email protected]
- [PATCH] [DLM] fix a couple of races
- From: [email protected]
- [PATCH] [GFS2] kernel changes to support new gfs2_grow command
- From: [email protected]
- [PATCH] [GFS2] Kernel changes to support new gfs2_grow command (part 2)
- From: [email protected]
- [PATCH] [GFS2] use zero_user_page
- From: [email protected]
- [PATCH] [GFS2] Addendum patch 2 for gfs2_grow
- From: [email protected]
- [PATCH] [GFS2] Reduce size of struct gdlm_lock
- From: [email protected]
- [PATCH] [GFS2] Clean up inode number handling
- From: [email protected]
- [PATCH] [GFS2] Quotas non-functional - fix bug
- From: [email protected]
- [PATCH] [DLM] keep dlm from panicing when traversing rsb list in debugfs
- From: [email protected]
- [PATCH] [DLM] block scand during recovery [1/6]
- From: [email protected]
- [PATCH] [DLM] add lock timeouts and warnings [2/6]
- From: [email protected]
- [PATCH] [DLM] dlm_device interface changes [3/6]
- From: [email protected]
- [PATCH] [DLM] cancel in conversion deadlock [4/6]
- From: [email protected]
- [PATCH] [DLM] fix new_lockspace error exit [5/6]
- From: [email protected]
- [PATCH] [DLM] wait for config check during join [6/6]
- From: [email protected]
- [PATCH] [DLM] fix compile breakage
- From: [email protected]
- [PATCH] [GFS2] latest gfs2-nmw headers break userland build
- From: [email protected]
- [PATCH] [DLM] Compile fix
- From: [email protected]
- [PATCH] [DLM] timeout fixes
- From: [email protected]
- [PATCH] [DLM] canceling deadlocked lock
- From: [email protected]
- [PATCH] [DLM] dumping master locks
- From: [email protected]
- [PATCH] [DLM] show default protocol
- From: [email protected]
- [PATCH] [GFS2] Quotas non-functional - fix another bug
- From: [email protected]
- [PATCH] [GFS2] Make the log reserved blocks depend on block size
- From: [email protected]
- [PATCH] [DLM] fix socket shutdown
- From: [email protected]
- [PATCH] [GFS2] fix jdata issues
- From: [email protected]
- [PATCH] [GFS2] Fix sign problem in quota/statfs and cleanup _host structures
- From: [email protected]
- [PATCH] [GFS2] Add nanosecond timestamp feature
- From: [email protected]
- [PATCH] [DLM] fix reference counting
- From: [email protected]
- [PATCH] [DLM] variable allocation
- From: [email protected]
- [PATCH] [GFS2] Fix typo in rename of directories
- From: [email protected]
- [GFS2/DLM] Pre-pull Patch Posting
- Prev by Date: [PATCH] [DLM] variable allocation
- Next by Date: [PATCH] [GFS2] Can't mount GFS2 file system on AoE device
- Previous by thread: [PATCH] [GFS2] Fix typo in rename of directories
- Next by thread: [PATCH] [GFS2] Can't mount GFS2 file system on AoE device
- Index(es):