linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Neil Brown <neilb@cse.unsw.edu.au>
To: Patrick Mau <mau@oscar.ping.de>
Cc: "Malte Schröder" <MalteSch@gmx.de>, linux-kernel@vger.kernel.org
Subject: Re: [PROBLEM] [2.6.0-test6] Stale NFS file handle
Date: Thu, 16 Oct 2003 15:17:02 +1000	[thread overview]
Message-ID: <16270.10702.689027.346924@notabene.cse.unsw.edu.au> (raw)
In-Reply-To: message from Patrick Mau on Sunday September 28

On Sunday September 28, mau@oscar.ping.de wrote:
> 
> I stumbled over the following lines of code in fs/nfsd/nfsfh.c:
> 
> int nfsd_acceptable(void *expv, struct dentry *dentry)
> {
>         struct svc_export *exp = expv;
>         int rv;
>         struct dentry *tdentry;
>         struct dentry *parent;
> 
>         if (exp->ex_flags & NFSEXP_NOSUBTREECHECK)
>                 return 1;
> 
>         tdentry = dget(dentry);
>         while (tdentry != exp->ex_dentry && ! IS_ROOT(tdentry)) {
>                 /* make sure parents give x permission to user */
>                 int err;
>                 parent = dget_parent(tdentry);
>                 err = permission(parent->d_inode, S_IXOTH, NULL);
>                                                   ^^^^^^^ <- !!!!
>                 if (err < 0) {
>                         dput(parent);
>                         break;
>                 }
> 
> First, nfsd_acceptable always returns success if subtree_checks are
> diabled. Second, I think, the line marked above is not correct.
> 
> The comment says "give x permission to user", but the call looks
> suspiciously wrong.

I think it is correct, though arguably it should be "MAY_EXEC" rather
than "S_IXOTH" (both of which are '1').
The permission call checks if the current user (which is computed from
the rpc credentials) has eXecute access to the directories.

> 
> You can also make the error disappear by allowing setting all x bits
> for "other" from your mount-point down to the directory where the error
> appears.

Have you actually tried this or are you just assuming?

> 
> Echoing "32767" to /proc/sys/sunrpx/nfs_debug helped me a great deal
> to find that error.

Presumably you got lots of "nfsd_acceptable failed at ....".  Is that
correct? 

I guess I need to do some testing with "subtree_check" set and see if
I can reproduce it.

NeilBrown

      parent reply	other threads:[~2003-10-16  5:17 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-28 18:30 [PROBLEM] [2.6.0-test6] Stale NFS file handle Malte Schröder
2003-09-28 18:48 ` Axel Siebenwirth
2003-09-29 17:42   ` Malte Schröder
2003-09-29 20:06   ` bill davidsen
2003-09-28 20:47 ` Patrick Mau
2003-09-29 18:58   ` Patrick Mau
2003-09-30  4:41     ` Malte Schröder
2003-10-16  5:17   ` Neil Brown [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=16270.10702.689027.346924@notabene.cse.unsw.edu.au \
    --to=neilb@cse.unsw.edu.au \
    --cc=MalteSch@gmx.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mau@oscar.ping.de \
    /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).