From 6d2f0127b2c6a4d518135fd014caa5be7c148eb1 Mon Sep 17 00:00:00 2001 From: "John L. Hammond" Date: Sun, 18 Sep 2016 16:38:38 -0400 Subject: [PATCH] staging: lustre: llite: unlock inode size in ll_lov_setstripe_ea_info() In ll_lov_setstripe_ea_info() release the inode size lock on all appropriate exit paths. Signed-off-by: John L. Hammond Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6059 Reviewed-on: http://review.whamcloud.com/13167 Reviewed-by: Jinshan Xiong Reviewed-by: Andreas Dilger Reviewed-by: Lai Siyao Signed-off-by: James Simmons Signed-off-by: Greg Kroah-Hartman --- drivers/staging/lustre/lustre/llite/file.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/staging/lustre/lustre/llite/file.c b/drivers/staging/lustre/lustre/llite/file.c index 2cb0b6541057..ce96c9f9af9b 100644 --- a/drivers/staging/lustre/lustre/llite/file.c +++ b/drivers/staging/lustre/lustre/llite/file.c @@ -1301,7 +1301,10 @@ int ll_lov_setstripe_ea_info(struct inode *inode, struct dentry *dentry, int lum_size) { struct lov_stripe_md *lsm = NULL; - struct lookup_intent oit = {.it_op = IT_OPEN, .it_flags = flags}; + struct lookup_intent oit = { + .it_op = IT_OPEN, + .it_flags = flags | MDS_OPEN_BY_FID, + }; int rc = 0; lsm = ccc_inode_lsm_get(inode); @@ -1314,13 +1317,12 @@ int ll_lov_setstripe_ea_info(struct inode *inode, struct dentry *dentry, } ll_inode_size_lock(inode); - oit.it_flags |= MDS_OPEN_BY_FID; rc = ll_intent_file_open(dentry, lum, lum_size, &oit); - if (rc) + if (rc < 0) goto out_unlock; rc = oit.it_status; if (rc < 0) - goto out_req_free; + goto out_unlock; ll_release_openhandle(inode, &oit); @@ -1330,9 +1332,6 @@ out_unlock: ccc_inode_lsm_put(inode, lsm); out: return rc; -out_req_free: - ptlrpc_req_finished((struct ptlrpc_request *)oit.it_request); - goto out; } int ll_lov_getstripe_ea_info(struct inode *inode, const char *filename, -- 2.39.5