In mdt_intent_opc() check that the reply has been packed before trying
to adjust the lock policy result.
Signed-off-by: John L. Hammond <john.hammond@intel.com>
Change-Id: Iab2858bf26390e6c305fcca6b7b7e0bc1be32a71
Reviewed-on: http://review.whamcloud.com/6617
Tested-by: Hudson
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
/* execute policy */
rc = flv->it_act(opc, info, lockp, flags);
- rep = req_capsule_server_get(pill, &RMF_DLM_REP);
- rep->lock_policy_res2 =
- ptlrpc_status_hton(rep->lock_policy_res2);
+ /* Check whether the reply has been packed successfully. */
+ if (mdt_info_req(info)->rq_repmsg != NULL) {
+ rep = req_capsule_server_get(info->mti_pill,
+ &RMF_DLM_REP);
+ rep->lock_policy_res2 =
+ ptlrpc_status_hton(rep->lock_policy_res2);
+ }
} else {
rc = -EOPNOTSUPP;
}