diff options
author | James Lentini <jlentini@netapp.com> | 2007-12-10 11:24:48 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2007-12-11 22:01:59 -0500 |
commit | 50e1092b3a119bb4660bb6bd2e1749dc2d8ac62e (patch) | |
tree | 68278271b9dc445ad9d2f2b0475930968c8568fc | |
parent | 5cef338b30c110daf547fb13d99f0c77f2a79fbc (diff) |
SUNRPC xprtrdma: fix XDR tail buf marshalling for all ops
rpcrdma_convert_iovs is passed an xdr_buf representing either an RPC
request or an RPC reply. In the case of a request, several
calculations and tests involving pos are unnecessary. In the case of a
reply, several calculations and tests involving pos are incorrect (the
code tests pos against the reply xdr buf's len field, which is always
0 at the time rpcrdma_convert_iovs is executed). This change removes
the incorrect/unnecessary calculations and tests involving pos.
This fixes an observed problem when reading certain file sizes over
NFS/RDMA.
Signed-off-by: Tom Tucker <tom@opengridcomputing.com>
Signed-off-by: Tom Talpey <talpey@netapp.com>
Signed-off-by: James Lentini <jlentini@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
-rw-r--r-- | net/sunrpc/xprtrdma/rpc_rdma.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/net/sunrpc/xprtrdma/rpc_rdma.c b/net/sunrpc/xprtrdma/rpc_rdma.c index 9e11ce715958..ee8de7af2a5b 100644 --- a/net/sunrpc/xprtrdma/rpc_rdma.c +++ b/net/sunrpc/xprtrdma/rpc_rdma.c | |||
@@ -92,7 +92,6 @@ rpcrdma_convert_iovs(struct xdr_buf *xdrbuf, int pos, | |||
92 | seg[n].mr_page = NULL; | 92 | seg[n].mr_page = NULL; |
93 | seg[n].mr_offset = xdrbuf->head[0].iov_base; | 93 | seg[n].mr_offset = xdrbuf->head[0].iov_base; |
94 | seg[n].mr_len = xdrbuf->head[0].iov_len; | 94 | seg[n].mr_len = xdrbuf->head[0].iov_len; |
95 | pos += xdrbuf->head[0].iov_len; | ||
96 | ++n; | 95 | ++n; |
97 | } | 96 | } |
98 | 97 | ||
@@ -104,7 +103,6 @@ rpcrdma_convert_iovs(struct xdr_buf *xdrbuf, int pos, | |||
104 | seg[n].mr_len = min_t(u32, | 103 | seg[n].mr_len = min_t(u32, |
105 | PAGE_SIZE - xdrbuf->page_base, xdrbuf->page_len); | 104 | PAGE_SIZE - xdrbuf->page_base, xdrbuf->page_len); |
106 | len = xdrbuf->page_len - seg[n].mr_len; | 105 | len = xdrbuf->page_len - seg[n].mr_len; |
107 | pos += len; | ||
108 | ++n; | 106 | ++n; |
109 | p = 1; | 107 | p = 1; |
110 | while (len > 0) { | 108 | while (len > 0) { |
@@ -119,20 +117,15 @@ rpcrdma_convert_iovs(struct xdr_buf *xdrbuf, int pos, | |||
119 | } | 117 | } |
120 | } | 118 | } |
121 | 119 | ||
122 | if (pos < xdrbuf->len && xdrbuf->tail[0].iov_len) { | 120 | if (xdrbuf->tail[0].iov_len) { |
123 | if (n == nsegs) | 121 | if (n == nsegs) |
124 | return 0; | 122 | return 0; |
125 | seg[n].mr_page = NULL; | 123 | seg[n].mr_page = NULL; |
126 | seg[n].mr_offset = xdrbuf->tail[0].iov_base; | 124 | seg[n].mr_offset = xdrbuf->tail[0].iov_base; |
127 | seg[n].mr_len = xdrbuf->tail[0].iov_len; | 125 | seg[n].mr_len = xdrbuf->tail[0].iov_len; |
128 | pos += xdrbuf->tail[0].iov_len; | ||
129 | ++n; | 126 | ++n; |
130 | } | 127 | } |
131 | 128 | ||
132 | if (pos < xdrbuf->len) | ||
133 | dprintk("RPC: %s: marshaled only %d of %d\n", | ||
134 | __func__, pos, xdrbuf->len); | ||
135 | |||
136 | return n; | 129 | return n; |
137 | } | 130 | } |
138 | 131 | ||