@@ -2507,8 +2507,10 @@ int ll_prep_inode(struct inode **inode, struct ptlrpc_request *req,
/* cleanup will be done if necessary */
md_free_lustre_md(sbi->ll_md_exp, &md);
- if (rc != 0 && it && it->it_op & IT_OPEN)
+ if (rc != 0 && it && it->it_op & IT_OPEN) {
+ ll_intent_drop_lock(it);
ll_open_cleanup(sb ? sb : (*inode)->i_sb, req);
+ }
return rc;
}
@@ -709,8 +709,10 @@ static int ll_lookup_it_finish(struct ptlrpc_request *request,
}
out:
- if (rc != 0 && it->it_op & IT_OPEN)
+ if (rc != 0 && it->it_op & IT_OPEN) {
+ ll_intent_drop_lock(it);
ll_open_cleanup((*de)->d_sb, request);
+ }
return rc;
}