Linux NFS development
 help / color / mirror / Atom feed
From: Olaf Kirch <okir@suse.de>
To: nfs@lists.sourceforge.net
Subject: [PATCH] Stop recvfrom errors from killing nfsd
Date: Tue, 21 Sep 2004 11:54:14 +0200	[thread overview]
Message-ID: <20040921095414.GP22254@suse.de> (raw)


[-- 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 --]

                 reply	other threads:[~2004-09-21  9:54 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040921095414.GP22254@suse.de \
    --to=okir@suse.de \
    --cc=nfs@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox