From 54d7c3fc1cb808676dbf337b83cd04c51925242d Mon Sep 17 00:00:00 2001 From: Li Wei Date: Mon, 15 Oct 2012 09:29:36 +0800 Subject: [PATCH] LU-1717 ldlm: Fix rs_opc initialization By the time target_send_reply() initializes rs_opc, rs_msg has not been filled with a valid opc yet. Following Oleg's suggestion on the Jira ticket, this patch changes target_send_reply() to initialize rs_opc with rq_reqmsg instead and silences a couple of related warnings that are of only informative nature. Change-Id: I4b96454e0bcf3dd0dc8f21b0de70a89ce37faacf Signed-off-by: Li Wei Reviewed-on: http://review.whamcloud.com/4271 Tested-by: Hudson Reviewed-by: Oleg Drokin Reviewed-by: Andreas Dilger Tested-by: Maloo --- lustre/ldlm/ldlm_lib.c | 2 +- lustre/mdt/mdt_recovery.c | 10 +++++----- lustre/ptlrpc/service.c | 10 +++++----- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/lustre/ldlm/ldlm_lib.c b/lustre/ldlm/ldlm_lib.c index 54780a7..a85eea8 100644 --- a/lustre/ldlm/ldlm_lib.c +++ b/lustre/ldlm/ldlm_lib.c @@ -2460,7 +2460,7 @@ void target_send_reply(struct ptlrpc_request *req, int rc, int fail_id) rs->rs_xid = req->rq_xid; rs->rs_transno = req->rq_transno; rs->rs_export = exp; - rs->rs_opc = lustre_msg_get_opc(rs->rs_msg); + rs->rs_opc = lustre_msg_get_opc(req->rq_reqmsg); cfs_spin_lock(&exp->exp_uncommitted_replies_lock); CDEBUG(D_NET, "rs transno = "LPU64", last committed = "LPU64"\n", diff --git a/lustre/mdt/mdt_recovery.c b/lustre/mdt/mdt_recovery.c index 1872119..6c07c5f 100644 --- a/lustre/mdt/mdt_recovery.c +++ b/lustre/mdt/mdt_recovery.c @@ -615,11 +615,11 @@ static void mdt_steal_ack_locks(struct ptlrpc_request *req) cfs_list_del_init (&oldrep->rs_exp_list); - CWARN("Stealing %d locks from rs %p x"LPD64".t"LPD64 - " o%d NID %s\n", - oldrep->rs_nlocks, oldrep, - oldrep->rs_xid, oldrep->rs_transno, oldrep->rs_opc, - libcfs_nid2str(exp->exp_connection->c_peer.nid)); + CDEBUG(D_HA, "Stealing %d locks from rs %p x"LPD64".t"LPD64 + " o%d NID %s\n", + oldrep->rs_nlocks, oldrep, + oldrep->rs_xid, oldrep->rs_transno, oldrep->rs_opc, + libcfs_nid2str(exp->exp_connection->c_peer.nid)); for (i = 0; i < oldrep->rs_nlocks; i++) ptlrpc_save_lock(req, &oldrep->rs_locks[i], diff --git a/lustre/ptlrpc/service.c b/lustre/ptlrpc/service.c index 0d44ac1..0746e71 100644 --- a/lustre/ptlrpc/service.c +++ b/lustre/ptlrpc/service.c @@ -2105,11 +2105,11 @@ ptlrpc_handle_rs(struct ptlrpc_reply_state *rs) if (nlocks == 0 && !been_handled) { /* If we see this, we should already have seen the warning * in mds_steal_ack_locks() */ - CWARN("All locks stolen from rs %p x"LPD64".t"LPD64 - " o%d NID %s\n", - rs, - rs->rs_xid, rs->rs_transno, rs->rs_opc, - libcfs_nid2str(exp->exp_connection->c_peer.nid)); + CDEBUG(D_HA, "All locks stolen from rs %p x"LPD64".t"LPD64 + " o%d NID %s\n", + rs, + rs->rs_xid, rs->rs_transno, rs->rs_opc, + libcfs_nid2str(exp->exp_connection->c_peer.nid)); } if ((!been_handled && rs->rs_on_net) || nlocks > 0) { -- 1.8.3.1