Linux NFS development
 help / color / mirror / Atom feed
From: Trond Myklebust <trondmy@hammerspace.com>
To: "anchalag@amazon.com" <anchalag@amazon.com>
Cc: "linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>,
	"anna.schumaker@netapp.com" <anna.schumaker@netapp.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] NFS: Retry the CLOSE if the embedded GETATTR is rejected with ERR_STALE
Date: Wed, 18 Nov 2020 22:13:16 +0000	[thread overview]
Message-ID: <8f08df90240f8a040bec5e7cf8d280aab25f9ead.camel@hammerspace.com> (raw)
In-Reply-To: <20201118212935.GA12762@dev-dsk-anchalag-2a-9c2d1d96.us-west-2.amazon.com>

On Wed, 2020-11-18 at 21:29 +0000, Anchal Agarwal wrote:
> On Wed, Nov 18, 2020 at 03:17:20AM +0000, Trond Myklebust wrote:
> > CAUTION: This email originated from outside of the organization. Do
> > not click links or open attachments unless you can confirm the
> > sender and know the content is safe.
> > 
> > 
> > 
> > On Wed, 2020-11-18 at 00:24 +0000, Anchal Agarwal wrote:
> > > If our CLOSE RPC call is rejected with an ERR_STALE error, then
> > > we
> > > should remove the GETATTR call from the compound RPC and retry.
> > > This could happen in a scenario where two clients tries to access
> > > the same file. One client opens the file and the other client
> > > removes
> > > the file while it's opened by first client. When the first client
> > > attempts to close the file the server returns ESTALE and the file
> > > ends
> > > up being leaked on the server. This depends on how nfs server is
> > > configured and is not reproducible if running against nfsd.
> > 
> > That would be a seriously broken server. If you return
> > NFS4ERR_STALE to
> > the client, you cannot expect any further interaction with that
> > file
> > from the client. It won't try to send CLOSE or DELEGRETURN or any
> > other
> > stateful operation.
> > 
> In this scenario, the setup we have at EFS is more of a distributed
> fashion. Multiple
> clients are connected to multiple servers with a common filesystem.
> So the above
> scenario leads to leaked open file handles on the client that tries
> to close deleted
> file. So I was of the view, in that case client could retry close
> without getattr
> in the close sequence without anything to do on server side.


If you send the client an NFS4ERR_STALE, you are telling it that its
access to the file has been revoked. That is not a temporary error, it
is a fatal one. The client is not responsible for cleaning up any
state.

-- 
Trond Myklebust
Linux NFS client maintainer, Hammerspace
trond.myklebust@hammerspace.com



  reply	other threads:[~2020-11-18 22:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-18  0:24 [PATCH] NFS: Retry the CLOSE if the embedded GETATTR is rejected with ERR_STALE Anchal Agarwal
2020-11-18  3:17 ` Trond Myklebust
2020-11-18 21:29   ` Anchal Agarwal
2020-11-18 22:13     ` Trond Myklebust [this message]
2020-11-19 19:24       ` Anchal Agarwal

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=8f08df90240f8a040bec5e7cf8d280aab25f9ead.camel@hammerspace.com \
    --to=trondmy@hammerspace.com \
    --cc=anchalag@amazon.com \
    --cc=anna.schumaker@netapp.com \
    --cc=linux-kernel@vger.kernel.org \
    --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