From d6954c0e5248aaa6e69fd0f3cc2478c3fb1d6c8f Mon Sep 17 00:00:00 2001 From: "John L. Hammond" Date: Wed, 12 Jun 2013 13:15:14 -0500 Subject: [PATCH] LU-3453 mdt: check for packed reply in mdt_intent_opc() 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 Change-Id: Iab2858bf26390e6c305fcca6b7b7e0bc1be32a71 Reviewed-on: http://review.whamcloud.com/6617 Tested-by: Hudson Reviewed-by: Andreas Dilger Reviewed-by: Oleg Drokin Tested-by: Maloo --- lustre/mdt/mdt_handler.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lustre/mdt/mdt_handler.c b/lustre/mdt/mdt_handler.c index d1340de..78d994c 100644 --- a/lustre/mdt/mdt_handler.c +++ b/lustre/mdt/mdt_handler.c @@ -3970,9 +3970,13 @@ static int mdt_intent_opc(long itopc, struct mdt_thread_info *info, /* 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; } -- 1.8.3.1