[PATCH 2/5] Allocate a callback request only if you have a mempool<br>
Rahul
Rahul
Fri May 25 15:18:09 EDT 2007
<br>
This patch adds a check for xprt->bc_mempool != NULL in xs_tcp_read_request.<br>
This is for cases when you may receive a packet with the call header set. If<br>
you're not expecting callbacks on the channel (e.g NFSv4.0), the code will<br>
panic<br>
<br>
i don't get when NFSv4.0 would set the call header.<br>
<br>
Signed-off-by: Rahul Iyer <<a href="mailto:iyer at netapp.com">iyer at netapp.com</a>><br>
---<br>
net/sunrpc/xprtsock.c | 9 ++++++++-<br>
1 files changed, 8 insertions(+), 1 deletions(-)<br>
<br>
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c<br>
index 94cc6dd..8c24516 100644<br>
--- a/net/sunrpc/xprtsock.c<br>
+++ b/net/sunrpc/xprtsock.c<br>
@@ -691,7 +691,14 @@ static inline void xs_tcp_read_request(struct rpc_xprt *xprt, skb_reader_t *desc<br>
calldir = ntohl(xprt->tcp_calldir);<br>
if (calldir == RPC_CALL) {<br>
<br>
- req = xprt_alloc_bc_request(xprt);<br>
+ if (xprt->bc_mempool)<br>
+
req = xprt_alloc_bc_request(xprt);<br>
+ else {<br>
+
/*<br>
+
* Received callback when none is expected<br>
+
*/<br>
+
req = NULL;<br>
+ }<br>
<br>
if (!req) {<br>
printk(KERN_NOTICE "Couldn't get rpc_rqst for the allback! Dropping
callback...\n");<br>
--<br>
<br>
don't you want to move the KERN_NOTICE into the case where xprt_alloc_bc_request fails?<br>
<br>
-->Andy<br>
</div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Thanks<br>Regards<br>Rahul<br><br>
</blockquote></div><br>
------=_Part_12247_26634023.1180624924764--
More information about the pNFS
mailing list