mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] SUNRPC: have soft RPC tasks return -ETIMEDOUT instead of -EIO on major connect timeout
@ 2008-03-29 12:49 Jeff Layton
  2008-03-29 16:44 ` Trond Myklebust
  0 siblings, 1 reply; 6+ messages in thread
From: Jeff Layton @ 2008-03-29 12:49 UTC (permalink / raw)
  To: linux-nfs, nfsv4; +Cc: linux-kernel

NFSv4 background mounts do not currently work correctly. While we could
try to fix this in userspace, I think it's really a kernel problem...

When a soft RPC tasks experiences a major timeout during a connection
attempt, it does an rpc_exit with a return code of -EIO. For NFSv4
mounts, this makes the mount() syscall return -EIO. mount.nfs4 then
interprets that as a "permanent" error, and won't attempt a background
mount when bg is specified. Fix this by making call_timeout() do the
rpc_exit() with an error of -ETIMEDOUT.

This fixes the background mount issue, but does make other syscalls
on soft mounts return ETIMEDOUT instead of EIO in this situation.

Comments welcome.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
---
 net/sunrpc/clnt.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
index 8c6a7f1..b6d409e 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -1162,7 +1162,7 @@ call_timeout(struct rpc_task *task)
 	if (RPC_IS_SOFT(task)) {
 		printk(KERN_NOTICE "%s: server %s not responding, timed out\n",
 				clnt->cl_protname, clnt->cl_server);
-		rpc_exit(task, -EIO);
+		rpc_exit(task, -ETIMEDOUT);
 		return;
 	}
 
-- 
1.5.3.6


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-03-31 19:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-29 12:49 [PATCH] SUNRPC: have soft RPC tasks return -ETIMEDOUT instead of -EIO on major connect timeout Jeff Layton
2008-03-29 16:44 ` Trond Myklebust
2008-03-29 19:24   ` Jeff Layton
2008-03-29 20:05     ` Trond Myklebust
2008-03-29 20:53       ` Jeff Layton
2008-03-31 19:53   ` Chuck Lever

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®