[pnfs] [PATCH 02/19] nfs41: Skip past the RPC call direction
Benny Halevy
bhalevy at panasas.com
Wed Jul 16 05:29:36 EDT 2008
From: Ricardo Labiaga <Ricardo.Labiaga at netapp.com>
xs_tcp_read_calldir() is now responsible for reading the RPC call
direction and determining whether it is a reply or a callback request.
The call to xdr_skb_read_bits() inside xs_tcp_read_calldir() moves the
xdr_skb_reader offset past the RPC call direction (offset should be
equal to 8). Therefore xs_tcp_read_common() called from
xs_tcp_ready_reply() should be copying the TCP buffer starting past the
RPC call direction. It is now necessary to read the RPC call direction
earlier to determine whether to call the reply handler or the callback
handler.
call_verify() should therefore skip past the XID and call/reply flag.
Signed-off-by: Ricardo Labiaga <Ricardo.Labiaga at netapp.com>
Signed-off-by: Benny Halevy <bhalevy at panasas.com>
[overriden [FIXME] nfs41: sunrpc: do not verify calldir in call_verify]
Originall in "nfs41: sunrpc: client side rpc changes"
call_verify skips the call/reply flag like this:
@@ -1355,13 +1377,8 @@ call_verify(struct rpc_task *task)
}
if ((len -= 3) < 0)
goto out_overflow;
- p += 1; /* skip XID */
+ p += 2; /* skip XID and the call/reply flag */
- if ((n = ntohl(*p++)) != RPC_REPLY) {
- dprintk("RPC: %5u %s: not an RPC reply: %x\n",
- task->tk_pid, __FUNCTION__, n);
- goto out_garbage;
- }
if ((n = ntohl(*p++)) != RPC_MSG_ACCEPTED) {
if (--len < 0)
goto out_overflow;
Signed-off-by: Benny Halevy <bhalevy at panasas.com>
---
net/sunrpc/clnt.c | 13 +++++++------
1 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
index 2c60022..b9f0173 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -1365,13 +1365,14 @@ call_verify(struct rpc_task *task)
}
if ((len -= 3) < 0)
goto out_overflow;
- p += 1; /* skip XID */
- if ((n = ntohl(*p++)) != RPC_REPLY) {
- dprintk("RPC: %5u %s: not an RPC reply: %x\n",
- task->tk_pid, __func__, n);
- goto out_garbage;
- }
+ /*
+ * Skip the XID and call direction.
+ * The underlying transport has read the XID and RPC call direction
+ * to determine this is an RPC reply.
+ */
+ p += 2;
+
if ((n = ntohl(*p++)) != RPC_MSG_ACCEPTED) {
if (--len < 0)
goto out_overflow;
--
1.5.6.3
More information about the pNFS
mailing list