public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Neil Brown <neilb@suse.de>
To: Trond Myklebust <Trond.Myklebust@netapp.com>
Cc: linux-nfs@vger.kernel.org, NFSv4@linux-nfs.org
Subject: NFS4ERR_FILE_OPEN handling in Linux
Date: Thu, 15 Oct 2009 11:35:28 +1100	[thread overview]
Message-ID: <19158.28240.964203.341327@notabene.brown> (raw)


Hi Trond,

 Following up for a customer who had problem with NFSv4 when talking
 to a Solaris server with "nbman" enabled, I have questions about the
 handling of NFS4ERR_FILE_OPEN.
 In particular:
   1/ should commit c514983d8d2260020543a81589a2b8c7d4bdab4e be
      reverted, and
   2/ should nfs_errtbl map NFS4ERR_FILE_OPEN to -EBUSY rather than
      defaulting to -EIO

 That commit, included below for reference, causes the NFS client to
 retry indefinitely if NFS4ERR_FILE_OPEN is returned.  This
 contradicts the comment which suggests it will only "retry a few
 times" and cannot be correct as a file could be held open (thus
 causing the error) indefinitely.

 The problem that the patch claims to address (relating to ordering of
 async calls) is, I believe, addressed properly by the subsequent
 patch

commit a49c3c7736a2e77931dabc5bc4a83fb4b2da013e
Author: Trond Myklebust <Trond.Myklebust@netapp.com>
Date:   Thu Oct 18 18:03:27 2007 -0400

    NFSv4: Ensure that we wait for the CLOSE request to complete
    

 So I believe that first patch is both unnecessary and incorrect.


 When the server refuses to perform an action because the file is
 currently open, I think 'EIO' does not do justice to the situation at
 all.  EBUSY seems a lot more appropriate and does seem to be a
 permitted error code for e.g. rename(2) and unlink(2).  EACCES might
 be a possible alternate.  It doesn't really mean the same thing, but
 it is likely to be handled in an appropriate way.  Apparently the
 Solaris client returns EACCES.

 Thoughts?

Thanks,
NeilBrown



>From c514983d8d2260020543a81589a2b8c7d4bdab4e Mon Sep 17 00:00:00 2001
From: Trond Myklebust <Trond.Myklebust@netapp.com>
Date: Fri, 15 Sep 2006 08:25:04 -0400
Subject: [PATCH] NFSv4: Handle the condition NFS4ERR_FILE_OPEN

Retry a few times before we give up: the error is usually due to ordering
issues with asynchronous RPC calls.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
---
 fs/nfs/nfs4proc.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index c218cc4..c49ac3e 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -2891,6 +2891,7 @@ int nfs4_handle_exception(const struct nfs_server *server, int errorcode, struct
 			if (ret == 0)
 				exception->retry = 1;
 			break;
+		case -NFS4ERR_FILE_OPEN:
 		case -NFS4ERR_GRACE:
 		case -NFS4ERR_DELAY:
 			ret = nfs4_delay(server->client, &exception->timeout);
-- 
1.6.4.3



             reply	other threads:[~2009-10-15  0:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-15  0:35 Neil Brown [this message]
2009-10-15 12:53 ` NFS4ERR_FILE_OPEN handling in Linux Trond Myklebust
2009-10-15 20:57   ` NeilBrown

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=19158.28240.964203.341327@notabene.brown \
    --to=neilb@suse.de \
    --cc=NFSv4@linux-nfs.org \
    --cc=Trond.Myklebust@netapp.com \
    --cc=linux-nfs@vger.kernel.org \
    /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