Whamcloud - gitweb
LU-2360 ptlrpc: don't clobber rq_history_seq with CPT_ANY
authorJohn L. Hammond <john.hammond@intel.com>
Wed, 30 Jan 2013 02:23:13 +0000 (20:23 -0600)
committerOleg Drokin <oleg.drokin@intel.com>
Fri, 8 Feb 2013 23:25:44 +0000 (18:25 -0500)
In ptlrpc_req_add_history() don't allow service_parts with cpt CPT_ANY
(-1) to clobber the timestamp and sequence bits of rq_history_seq.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Change-Id: I52161d6f36dcd70dd569b0be294e6d23cc5ac4a9
Reviewed-on: http://review.whamcloud.com/5207
Tested-by: Hudson
Reviewed-by: Liang Zhen <liang.zhen@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
lustre/ptlrpc/events.c

index ef0b698..e2f098e 100644 (file)
@@ -261,7 +261,9 @@ static void ptlrpc_req_add_history(struct ptlrpc_service_part *svcpt,
         * it must be called with hold svcpt::scp_lock */
 
        new_seq = (sec << REQS_SEC_SHIFT) |
-                 (usec << REQS_USEC_SHIFT) | svcpt->scp_cpt;
+                 (usec << REQS_USEC_SHIFT) |
+                 (svcpt->scp_cpt < 0 ? 0 : svcpt->scp_cpt);
+
        if (new_seq > svcpt->scp_hist_seq) {
                /* This handles the initial case of scp_hist_seq == 0 or
                 * we just jumped into a new time window */