All of lore.kernel.org
 help / color / mirror / Atom feed
From: Olaf Kirch <okir@suse.de>
To: nfs@lists.sourceforge.net
Subject: [PATCH] Keep nfsd from exiting when seeing recv() errors
Date: Mon, 11 Jul 2005 11:45:32 +0200	[thread overview]
Message-ID: <20050711094531.GE27163@suse.de> (raw)

[-- Attachment #1: Type: text/plain, Size: 579 bytes --]

I think I submitted this one previously - svc_tcp_recvfrom currently
returns any errors to the caller, including ECONNRESET and the like.

This is something svc_recv isn't able to deal with:

	len = svsk->sk_recvfrom(rqstp);
	[...]
	if (len == 0 || len == -EAGAIN) {
		[...]
		return -EAGAIN;
	}

	[...]
	return len;

The nfsd main loop will exit when it sees an error code other than
EAGAIN.

The attached patch fixes this problem.

Olaf
-- 
Olaf Kirch   |  --- o --- Nous sommes du soleil we love when we play
okir@suse.de |    / | \   sol.dhoop.naytheet.ah kin.ir.samse.qurax

[-- Attachment #2: sunrpc-svc-recv-errors --]
[-- Type: text/plain, Size: 771 bytes --]

Subject: Keep nfsd from exiting when seeing recv() errors
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;


             reply	other threads:[~2005-07-11  9:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-11  9:45 Olaf Kirch [this message]
  -- strict thread matches above, loose matches on Subject: below --
2005-11-16 10:24 [PATCH] Keep nfsd from exiting when seeing recv() errors Olaf Kirch

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=20050711094531.GE27163@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.