Linux NFS development
 help / color / mirror / Atom feed
From: Trond Myklebust <trondmy@hammerspace.com>
To: "linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>,
	"sagi@grimberg.me" <sagi@grimberg.me>,
	"jlayton@kernel.org" <jlayton@kernel.org>
Cc: "hch@lst.de" <hch@lst.de>,
	"dan.aloni@vastdata.com" <dan.aloni@vastdata.com>,
	"chuck.lever@oracle.com" <chuck.lever@oracle.com>
Subject: Re: [PATCH rfc] nfs: propagate readlink errors in nfs_symlink_filler
Date: Wed, 22 May 2024 21:04:10 +0000	[thread overview]
Message-ID: <e4e181e4a7b2db4b27b6ce3e6bb26b23e514cdb1.camel@hammerspace.com> (raw)
In-Reply-To: <c1d98e76-1b5c-4d91-a7fe-9412df7c2fab@grimberg.me>

On Wed, 2024-05-22 at 22:40 +0300, Sagi Grimberg wrote:
> Hey Trond,
> 
> > > filehandle is stale? There will have been an unlink() on the
> > > symlink at
> > > some point in the recent past.
> > > 
> > 
> > No reason that I can see. However given that this was observed in
> > the 
> > wild, and essentially
> > a common pattern with symlinks (overwrite a config file for
> > example), 
> > I think its reasonable
> > to have the vfs at least do a single retry, by simply returning
> > ESTALE.
> > However NFS cannot distinguish between first and second retries 
> > afaict... Perhaps the
> > vfs can help with a ESTALE->ENOENT conversion?
> 
> So what do you suggest we do here? IMO at a minimum NFS should retry 
> once similar
> to nfs4_file_open (it would probably address 99.9% of the use-cases 
> where symlinks are
> not overwritten in a high enough frequency for the client to see 2 
> consecutive stale readlink
> rpc rplies).
> 
> I can send a patch paired with a vfs ESTALE conversion patch? 
> alternatively retry locally in NFS...
> I would like to understand your position here.
> 

Looking more closely at nfs_get_link(), it is obvious that it can
already return ESTALE (thanks to the call to nfs_revalidate_mapping())
and looking at do_readlinkat(), it has already been plumbed through
with a call to retry_estale().

So I think we can take your patch as is, since it doesn't add any error
cases that callers of readlink() don't have to handle already.

We might still want to think about cleaning up the output of the VFS in
all these cases, so that we don't return ESTALE when it isn't allowed
by POSIX, but that would be a separate task.

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



  reply	other threads:[~2024-05-22 21:04 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-21 12:58 [PATCH rfc] nfs: propagate readlink errors in nfs_symlink_filler Sagi Grimberg
2024-05-21 13:22 ` Jeff Layton
2024-05-21 14:36   ` Dan Aloni
2024-05-21 15:05   ` Sagi Grimberg
2024-05-21 15:13     ` Trond Myklebust
2024-05-21 15:24       ` Chuck Lever III
2024-05-22  4:41         ` Dan Aloni
2024-05-22 12:11           ` Trond Myklebust
2024-05-21 16:09       ` Sagi Grimberg
2024-05-22 19:40         ` Sagi Grimberg
2024-05-22 21:04           ` Trond Myklebust [this message]
2024-05-22 21:19             ` Sagi Grimberg
2024-05-30 18:08               ` Sagi Grimberg
2024-05-30 18:21                 ` Trond Myklebust
2024-05-31  4:24                   ` Sagi Grimberg
2024-05-22 21:20             ` Jeff Layton
2024-05-21 14:02 ` Chuck Lever
2024-05-21 14:59   ` Sagi Grimberg

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=e4e181e4a7b2db4b27b6ce3e6bb26b23e514cdb1.camel@hammerspace.com \
    --to=trondmy@hammerspace.com \
    --cc=chuck.lever@oracle.com \
    --cc=dan.aloni@vastdata.com \
    --cc=hch@lst.de \
    --cc=jlayton@kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=sagi@grimberg.me \
    /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