The attached patch adds some diagnostic prints to a number of error
exits in the RPC code. Currently these errors are all lumped together
as EIO, making it difficult to know the cause of a failure.
I've tested the patch here and didn't get any messages, so I hope these
will be infrequent in practice. If any of them do happen more
frequently, we should probably assign a more specific error code so
that problems can be better diagnosed.
Regards,
Bill
--------------644B649C3F3AB3E121D65EBC
Content-Type: text/plain; charset=us-ascii; name="sunrpc_65-patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="sunrpc_65-patch"
--- linux-2.1.65/net/sunrpc/clnt.c.old Sun Oct 12 13:17:46 1997
+++ linux-2.1.65/net/sunrpc/clnt.c Tue Nov 25 11:27:44 1997
@@ -338,8 +338,10 @@
} else {
task->tk_action = NULL;
}
- if (!task->tk_rqstp)
+ if (!task->tk_rqstp) {
+ printk("RPC: task has no request, exit EIO\n");
rpc_exit(task, -EIO);
+ }
}
/*
@@ -415,6 +417,7 @@
/* Encode header and provided arguments */
encode = rpcproc_encode(clnt, task->tk_proc);
if (!(p = call_header(task))) {
+ printk("RPC: call_header failed, exit EIO\n");
rpc_exit(task, -EIO);
} else
if ((status = encode(req, p, task->tk_argp)) < 0) {
@@ -749,6 +752,7 @@
task->tk_action = call_encode;
return NULL;
}
+ printk("RPC: garbage, exit EIO\n");
rpc_exit(task, -EIO);
return NULL;
}
--- linux-2.1.65/net/sunrpc/xprt.c.old Mon Sep 15 16:23:36 1997
+++ linux-2.1.65/net/sunrpc/xprt.c Tue Nov 25 11:26:30 1997
@@ -1009,18 +1009,11 @@
} else if (!RPCXPRT_CONGESTED(xprt)) {
/* OK: There's room for us. Grab a free slot and bump
* congestion value */
- if (!(req = xprt->free)) {
- /* printk("RPC: inconsistent free list!\n"); */
- rpc_debug = ~0;
- dprintk("RPC: %4d inconsistent free list "
- "(cong %ld cwnd %ld)\n",
- task->tk_pid, xprt->cong, xprt->cwnd);
- goto bummer;
- }
- if (req->rq_xid) {
- printk("RPC: used rqst slot %p on free list!\n", req);
- goto bummer;
- }
+ req = xprt->free;
+ if (!req)
+ goto bad_list;
+ if (req->rq_xid)
+ goto bad_used;
xprt->free = req->rq_next;
xprt->cong += RPC_CWNDSCALE;
task->tk_rqstp = req;
@@ -1035,6 +1028,13 @@
return;
+bad_list:
+ printk("RPC: %4d inconsistent free list (cong %ld cwnd %ld)\n",
+ task->tk_pid, xprt->cong, xprt->cwnd);
+ rpc_debug = ~0;
+ goto bummer;
+bad_used:
+ printk("RPC: used rqst slot %p on free list!\n", req);
bummer:
task->tk_status = -EIO;
xprt->free = NULL;
--------------644B649C3F3AB3E121D65EBC--