From fe3a9e410c937a2552a7dd948a4fbca4905e63ed Mon Sep 17 00:00:00 2001 From: Hongchao Zhang Date: Sun, 3 Feb 2013 15:27:49 +0800 Subject: [PATCH] LU-2832 ptlrpc: cleanup bulk for resend case 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 Reviewed-on: http://review.whamcloud.com/5532 Tested-by: Hudson Tested-by: Maloo Reviewed-by: Fan Yong Reviewed-by: Mike Pershin Reviewed-by: Oleg Drokin --- lustre/ptlrpc/niobuf.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lustre/ptlrpc/niobuf.c b/lustre/ptlrpc/niobuf.c index de23826..4a4eeb4 100644 --- a/lustre/ptlrpc/niobuf.c +++ b/lustre/ptlrpc/niobuf.c @@ -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; -- 1.8.3.1