Whamcloud - gitweb
LU-2832 ptlrpc: cleanup bulk for resend case
authorHongchao Zhang <hongchao.zhang@intel.com>
Sun, 3 Feb 2013 07:27:49 +0000 (15:27 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 5 Mar 2013 15:00:23 +0000 (10:00 -0500)
when the request with bulk(ptlrpc_bulk_desc) is resent or replayed,
the stats of the bulk should be cleaned up for it will be reused.

Change-Id: Ie340c8aa43e1a19595c50bed05134537d8d07d74
Signed-off-by: Hongchao Zhang <hongchao.zhang@intel.com>
Reviewed-on: http://review.whamcloud.com/5532
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: Mike Pershin <mike.pershin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/ptlrpc/niobuf.c

index de23826..4a4eeb4 100644 (file)
@@ -317,6 +317,12 @@ int ptlrpc_register_bulk(struct ptlrpc_request *req)
        LASSERT(desc->bd_type == BULK_PUT_SINK ||
                desc->bd_type == BULK_GET_SOURCE);
 
+       /* cleanup the state of the bulk for it will be reused */
+       if (req->rq_resend || req->rq_send_state == LUSTRE_IMP_REPLAY)
+               desc->bd_nob_transferred = 0;
+       else
+               LASSERT(desc->bd_nob_transferred == 0);
+
        desc->bd_failure = 0;
 
        peer = desc->bd_import->imp_connection->c_peer;