linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Trond Myklebust <trondmy@hammerspace.com>
To: "neilb@suse.de" <neilb@suse.de>, "steved@redhat.com" <steved@redhat.com>
Cc: "linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>
Subject: Re: help with understanding match_fsid() errors in nfs-utils
Date: Wed, 27 Sep 2023 23:00:18 +0000	[thread overview]
Message-ID: <7e00fd2c44df1bc34c219902498d95cb811de850.camel@hammerspace.com> (raw)
In-Reply-To: <169578061136.5939.6687963921006986794@noble.neil.brown.name>

On Wed, 2023-09-27 at 12:10 +1000, NeilBrown wrote:
> 
> hi Trond,
>  I'm trying to understand
> 
>  Commit 76c21e3f70a8 ("mountd: Check the stat() return values in
> match_fsid()")
> 
>  in nfs-utils.
> 
>  The effect of this patch is that if a 'stat' of any path in
>  /etc/exports or any mountpoint below any path marked crossmnt fails
>  with an error other than one of a small set, then the fsid to path
>  lookup aborts without reporting anything to the kernel, so the
> kernel
>  doesn't reply to the client and the mount attempt blocks
> indefinitely.
> 
>  I have seen this happen when "/" is exported crossmnt, and when a
> stat
>  of /run/user/1000/doc returns EACCES.  This is a "fuse" mount for
> user
>  1000, and presumably it rejects any access from any other user.
> 
>  Could you please help me understand what this patch was trying to
>  achieve?  What sorts of errors were you expecting this to catch?
>  Would it make sense to silently ignore the stat failure for paths
> that
>  were found when scanning the mount table, and only take the more
>  drastic action for paths explicitly listed in /etc/exports ??
> 
> 

The point is that if the filesystem is re-exported NFS, and you mount
as 'softerr' in order to avoid hanging your knfsd server on ephemeral
errors, then you have to be more careful about which errors are fatal,
and hence need to be propagated to the kernel export/path cache, and
which ones are just temporary due to a network partition or server
reboot.

Hence the creation of path_lookup_error() which differentiates between
the two cases.

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



  reply	other threads:[~2023-09-27 23:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-27  2:10 help with understanding match_fsid() errors in nfs-utils NeilBrown
2023-09-27 23:00 ` Trond Myklebust [this message]
2023-10-10 23:38   ` NeilBrown
2023-10-11 14:33     ` Trond Myklebust

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=7e00fd2c44df1bc34c219902498d95cb811de850.camel@hammerspace.com \
    --to=trondmy@hammerspace.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=neilb@suse.de \
    --cc=steved@redhat.com \
    /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).