In mdt_object_local_lock() call mdt_object_unlock() if mdt_fid_lock()
fails on the PDO lock. This is needed because ldlm_cli_enqueue_local()
may initialize the passed in lock handle and then fail later.
Signed-off-by: John L. Hammond <john.hammond@intel.com>
Change-Id: I17a01d569a77a86f8ce72a1617f0cb8ed500985b
Reviewed-on: http://review.whamcloud.com/11219
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: wangdi <di.wang@intel.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: Mike Pershin <mike.pershin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
policy, res_id, dlmflags,
info->mti_exp == NULL ? NULL :
&info->mti_exp->exp_handle.h_cookie);
policy, res_id, dlmflags,
info->mti_exp == NULL ? NULL :
&info->mti_exp->exp_handle.h_cookie);
- if (unlikely(rc))
- RETURN(rc);
+ if (unlikely(rc != 0))
+ GOTO(out_unlock, rc);
res_id, LDLM_FL_LOCAL_ONLY | dlmflags,
info->mti_exp == NULL ? NULL :
&info->mti_exp->exp_handle.h_cookie);
res_id, LDLM_FL_LOCAL_ONLY | dlmflags,
info->mti_exp == NULL ? NULL :
&info->mti_exp->exp_handle.h_cookie);
- if (rc)
- mdt_object_unlock(info, o, lh, 1);
- else if (unlikely(OBD_FAIL_PRECHECK(OBD_FAIL_MDS_PDO_LOCK)) &&
- lh->mlh_pdo_hash != 0 &&
- (lh->mlh_reg_mode == LCK_PW || lh->mlh_reg_mode == LCK_EX)) {
- OBD_FAIL_TIMEOUT(OBD_FAIL_MDS_PDO_LOCK, 15);
- }
+out_unlock:
+ if (rc != 0)
+ mdt_object_unlock(info, o, lh, 1);
+ else if (unlikely(OBD_FAIL_PRECHECK(OBD_FAIL_MDS_PDO_LOCK)) &&
+ lh->mlh_pdo_hash != 0 &&
+ (lh->mlh_reg_mode == LCK_PW || lh->mlh_reg_mode == LCK_EX))
+ OBD_FAIL_TIMEOUT(OBD_FAIL_MDS_PDO_LOCK, 15);