Blob Blame History Raw
From: Chuck Lever <chuck.lever@oracle.com>
Date: Wed, 3 Jan 2018 15:38:09 -0500
Subject: [PATCH] xprtrdma: Fix "bytes registered" accounting
Git-commit: aae2349c49198e5dc7376519201cb4647a902e0f
Patch-mainline: v4.16
References: git-fixes

The contents of seg->mr_len changed when ->ro_map stopped returning
the full chunk length in the first segment. Count the full length of
each Write chunk, not the length of the first segment (which now can
only be as large as a page).

Fixes: 9d6b04097882 ("xprtrdma: Place registered MWs on a ... ")
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Acked-by: NeilBrown <neilb@suse.com>

---
 net/sunrpc/xprtrdma/rpc_rdma.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/net/sunrpc/xprtrdma/rpc_rdma.c
+++ b/net/sunrpc/xprtrdma/rpc_rdma.c
@@ -400,7 +400,7 @@ rpcrdma_encode_write_list(struct rpcrdma
 			mw->mw_handle, n < nsegs ? "more" : "last");
 
 		r_xprt->rx_stats.write_chunk_count++;
-		r_xprt->rx_stats.total_rdma_request += seg->mr_len;
+		r_xprt->rx_stats.total_rdma_request += mw->mw_length;
 		nchunks++;
 		seg   += n;
 		nsegs -= n;
@@ -465,7 +465,7 @@ rpcrdma_encode_reply_chunk(struct rpcrdm
 			mw->mw_handle, n < nsegs ? "more" : "last");
 
 		r_xprt->rx_stats.reply_chunk_count++;
-		r_xprt->rx_stats.total_rdma_request += seg->mr_len;
+		r_xprt->rx_stats.total_rdma_request += mw->mw_length;
 		nchunks++;
 		seg   += n;
 		nsegs -= n;