When enabling hsm_control, mti_exp field of struct mdt_thread_info
could be NULL. ldlm_cli_enqueue_local will crash the kernel when
dereference it.
Signed-off-by: Li Xi <lixi@ddn.com>
Change-Id: I4bdb8222aec378e396e7f544834f6fcf9fdaf777
Reviewed-on: http://review.whamcloud.com/9543
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Faccini Bruno <bruno.faccini@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
* want it slowed down due to possible cancels.
*/
policy->l_inodebits.bits = MDS_INODELOCK_UPDATE;
* want it slowed down due to possible cancels.
*/
policy->l_inodebits.bits = MDS_INODELOCK_UPDATE;
- rc = mdt_fid_lock(ns, &lh->mlh_pdo_lh, lh->mlh_pdo_mode,
- policy, res_id, dlmflags,
- &info->mti_exp->exp_handle.h_cookie);
+ rc = mdt_fid_lock(ns, &lh->mlh_pdo_lh, lh->mlh_pdo_mode,
+ policy, res_id, dlmflags,
+ info->mti_exp == NULL ? NULL :
+ &info->mti_exp->exp_handle.h_cookie);
if (unlikely(rc))
RETURN(rc);
}
if (unlikely(rc))
RETURN(rc);
}
* going to be sent to client. If it is - mdt_intent_policy() path will
* fix it up and turn FL_LOCAL flag off.
*/
* going to be sent to client. If it is - mdt_intent_policy() path will
* fix it up and turn FL_LOCAL flag off.
*/
- rc = mdt_fid_lock(ns, &lh->mlh_reg_lh, lh->mlh_reg_mode, policy,
- res_id, LDLM_FL_LOCAL_ONLY | dlmflags,
- &info->mti_exp->exp_handle.h_cookie);
+ rc = mdt_fid_lock(ns, &lh->mlh_reg_lh, lh->mlh_reg_mode, policy,
+ 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)) &&
if (rc)
mdt_object_unlock(info, o, lh, 1);
else if (unlikely(OBD_FAIL_PRECHECK(OBD_FAIL_MDS_PDO_LOCK)) &&