Whamcloud - gitweb
LU-1717 ldlm: Fix rs_opc initialization
authorLi Wei <liwei@whamcloud.com>
Mon, 15 Oct 2012 01:29:36 +0000 (09:29 +0800)
committerOleg Drokin <green@whamcloud.com>
Mon, 15 Oct 2012 23:54:32 +0000 (19:54 -0400)
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 <liwei@whamcloud.com>
Reviewed-on: http://review.whamcloud.com/4271
Tested-by: Hudson
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
lustre/ldlm/ldlm_lib.c
lustre/mdt/mdt_recovery.c
lustre/ptlrpc/service.c

index 54780a7..a85eea8 100644 (file)
@@ -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_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",
 
         cfs_spin_lock(&exp->exp_uncommitted_replies_lock);
         CDEBUG(D_NET, "rs transno = "LPU64", last committed = "LPU64"\n",
index 1872119..6c07c5f 100644 (file)
@@ -615,11 +615,11 @@ static void mdt_steal_ack_locks(struct ptlrpc_request *req)
 
                 cfs_list_del_init (&oldrep->rs_exp_list);
 
 
                 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],
 
                 for (i = 0; i < oldrep->rs_nlocks; i++)
                         ptlrpc_save_lock(req, &oldrep->rs_locks[i],
index 0d44ac1..0746e71 100644 (file)
@@ -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()  */
         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) {
         }
 
         if ((!been_handled && rs->rs_on_net) || nlocks > 0) {