staging: lustre: llite: unlock inode size in ll_lov_setstripe_ea_info()
authorJohn L. Hammond <john.hammond@intel.com>
Sun, 18 Sep 2016 20:38:38 +0000 (16:38 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 19 Sep 2016 08:03:40 +0000 (10:03 +0200)
In ll_lov_setstripe_ea_info() release the inode size lock on all
appropriate exit paths.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6059
Reviewed-on: http://review.whamcloud.com/13167
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/llite/file.c

index 2cb0b6541057a3a86cfc87bb0c3f6fa39b3cb4c3..ce96c9f9af9b2c8236f34373fba4ab6ebfb3b177 100644 (file)
@@ -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,