Re: [PROBLEM] [2.6.0-test6] Stale NFS file handle

From: Patrick Mau
Date: Sun Sep 28 2003 - 15:49:08 EST


On Sun, Sep 28, 2003 at 08:30:50PM +0200, Malte Schröder wrote:
> Hi,
> since 2.6.0-test6 I get "Stale NFS file handle" when transferring
> huge amounts of data from a nfs-server which is running on -test6.
> The client also runs -test6. Transfers from a server running kernel 2.4.22
> work flawless.
>
> I use the nfs-kernel-server 1.0.6 on Debian/sid.

Hallo Malte,
Hallo list-members,

my solution for getting a reliable NFS Server with 2.5 kernels was
to use "no_subtree_check" in /etc/exports.

(The next thing is pasted, please read below the code)

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.

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.

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

Cheers,
Patrick
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/