linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton@redhat.com>
To: Andrei Warkentin <awarkentin@vmware.com>
Cc: linux-nfs@vger.kernel.org, Ed Goggin <egoggin@vmware.com>
Subject: Re: stale or not stale
Date: Fri, 3 Aug 2012 06:52:31 -0400	[thread overview]
Message-ID: <20120803065231.2e64ec8d@corrin.poochiereds.net> (raw)
In-Reply-To: <1592211005.4733808.1343960954717.JavaMail.root@vmware.com>

On Thu, 2 Aug 2012 19:29:14 -0700 (PDT)
Andrei Warkentin <awarkentin@vmware.com> wrote:

> ----- Original Message -----
> > From: "Ed Goggin" <egoggin@vmware.com>
> > To: linux-nfs@vger.kernel.org
> > Sent: Thursday, August 2, 2012 9:57:58 PM
> > Subject: stale or not stale
> > 
> > 
> > It seems that nfsd can return reply attributes with a link count of
> > zero but without an NFS3ERR_STALE status.  We've seen this actually
> > happen for a write request to a file with a single link that  is
> > concurrently being removed without NLM lock protection.  What is the
> > proper behavior here?
> 
> I think it would be worthwhile to add here that the the remove was not concurrent with the write, and at the time of the NFS write a new file with the same name existed, yet fh decoding picked up the old inode instead of reporting -ESTALE. FS was ext4.
> 
> In fact seen two things happen - n_link = 0 and n_link = 1, and in both cases we knew the file was unlink()ed and re-creat()ed.
> 

That's entirely valid behavior.

ESTALE from the server is its way of saying: "I don't recognize that
filehandle". It can't figure out how to match that filehandle to an
inode.

An i_nlink count of 0 means that there are no more hardlinks attached
to the inode. It's deleted from the namespace, but the inode still
exists until there are no more i_count references held on it.

-- 
Jeff Layton <jlayton@redhat.com>

      reply	other threads:[~2012-08-03 10:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-03  1:57 stale or not stale Ed Goggin
2012-08-03  2:29 ` Andrei Warkentin
2012-08-03 10:52   ` Jeff Layton [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=20120803065231.2e64ec8d@corrin.poochiereds.net \
    --to=jlayton@redhat.com \
    --cc=awarkentin@vmware.com \
    --cc=egoggin@vmware.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;
as well as URLs for NNTP newsgroup(s).