mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chuck Lever <chuck.lever@oracle.com>
To: Trond Myklebust <trond.myklebust@fys.uio.no>
Cc: Jeff Layton <jlayton@redhat.com>,
	linux-nfs@vger.kernel.org, nfsv4@linux-nfs.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] SUNRPC: have soft RPC tasks return -ETIMEDOUT instead of -EIO on major connect timeout
Date: Mon, 31 Mar 2008 15:53:58 -0400	[thread overview]
Message-ID: <D69D5ED0-F0B9-4E18-B3E2-F7AF2EC3E55F@oracle.com> (raw)
In-Reply-To: <1206809051.8480.33.camel@heimdal.trondhjem.org>

On Mar 29, 2008, at 12:44 PM, Trond Myklebust wrote:
> On Sat, 2008-03-29 at 08:49 -0400, Jeff Layton wrote:
>> 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;
>>  	}
>
> While that may be acceptable for the mount() syscall, I don't think
> POSIX applications are quite ready to deal with ETIMEDOUT as an error
> for stat() or chdir().

Having the RPC client throw -EIO on a timeout always seemed a little  
crude to me.  EIO is quite overloaded -- the same error is returned  
if there's a XDR decoding error, for example.  Clearly other  
consumers of RPC (mount, for example) would like a distinction  
between a timeout and an outright I/O error.

The fact that applications using NFS files can't deal with -ETIMEDOUT  
should probably be managed in the NFS client, not in the RPC client.   
Perhaps it could be handled with a wrapper function, like the NFS  
client handles EJUKEBOX.

So I agree that Jeff's patch is insufficient as it stands, but the  
underlying idea is probably a good one.

> Userland has the clnt_geterr() function that returns more detailed  
> 'RPC
> level' errors. While that 'error function call' approach doesn't  
> work in
> a multi-threaded environment, we might still be able to add the
> equivalent of a pointer to an 'rpc_err' structure to the rpc_task, and
> then have functions like call_timeout() (and especially call_verify 
> ()!)
> fill in more detailed error info if that pointer is non-zero?


That's not a bad idea either.

--
Chuck Lever
chuck[dot]lever[at]oracle[dot]com

      parent reply	other threads:[~2008-03-31 19:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-29 12:49 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 message]

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=D69D5ED0-F0B9-4E18-B3E2-F7AF2EC3E55F@oracle.com \
    --to=chuck.lever@oracle.com \
    --cc=jlayton@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=nfsv4@linux-nfs.org \
    --cc=trond.myklebust@fys.uio.no \
    /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

all inboxes | Powered by JetHome®