* [PATCH] Stop recvfrom errors from killing nfsd
@ 2004-09-21 9:54 Olaf Kirch
0 siblings, 0 replies; only message in thread
From: Olaf Kirch @ 2004-09-21 9:54 UTC (permalink / raw)
To: nfs
[-- Attachment #1.1: Type: text/plain, Size: 1018 bytes --]
Hi,
I just looked into a customer report about nfsd processes terminating
because svc_recv() returned -107.
This is caused by svc_tcp_recvfrom propagating errors such as ENOTCONN
and ECONNRESET up to svc_recv, which is not equipped to deal with this.
svc_recv expects the return value from svsk->sk_recvfrom to be either
positive (a packet length), 0 (accept call or incomplete record), or
-EAGAIN (no data). Any other error codes are treated just like a packet
length.
The original code in svc_tcp_recvfrom would always kill the socket
when it got an unexpected error, and return EAGAIN. This was changed
some time between 2.4.18 and 2.4.21 - I don't know for what reasons.
The patch below reverts that change.
Alternatively, we could add special case treatment for certain error codes;
e.g. propagating EINTR up to nfsd while making ECONNRESET and ENOTCONN
simply kill the connection.
Cheers,
Olaf
--
Olaf Kirch | The Hardware Gods hate me.
okir@suse.de |
---------------+
[-- Attachment #1.2: sunrpc-svc-recv-errors --]
[-- Type: text/plain, Size: 733 bytes --]
From: Olaf Kirch <okir@suse.de>
svc_recv is not equipped to deal with error codes other than EAGAIN,
and will propagate anything else (such as ECONNRESET) up to nfsd,
causing it to exit.
Signed-off-by: Olaf Kirch <okir@suse.de>
Index: 2.4.21/net/sunrpc/svcsock.c
===================================================================
--- 2.4.21.orig/net/sunrpc/svcsock.c 2003-06-13 16:51:39.000000000 +0200
+++ 2.4.21/net/sunrpc/svcsock.c 2004-09-20 13:11:53.000000000 +0200
@@ -894,7 +894,7 @@ svc_tcp_recvfrom(struct svc_rqst *rqstp)
} else {
printk(KERN_NOTICE "%s: recvfrom returned errno %d\n",
svsk->sk_server->sv_name, -len);
- svc_sock_received(svsk);
+ goto err_delete;
}
return len;
[-- Attachment #2: Type: application/pgp-signature, Size: 322 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2004-09-21 9:54 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-09-21 9:54 [PATCH] Stop recvfrom errors from killing nfsd Olaf Kirch
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox