Re: [NFS] Linux 2.2.18 nfs v3 server bug (was: Incompatible: FreeBSD 4.2 client, Linux 2.2.18 nfsv3 server, read-only export)

Neil Brown (neilb@cse.unsw.edu.au)
Wed, 24 Jan 2001 17:06:55 +1100 (EST)


On Wednesday January 24, matthias.andree@stud.uni-dortmund.de wrote:
> (Please consider removing FreeBSD-stable from the recipient list when
> replying.)
freebsd-stable removed! reiserfs gone. Who goes next:-? Alan?
>
> Summary:
>
> The Linux 2.2.18 NFS v3 server returns bogus and as per RFC-1813 invalid
> NFS3ERR_ROFS to ACCESS procedure calls when exporting a file system
> read-only, when it should instead return "OK" along with the actual
> permissions the client has, ANDed with the permissions the client
> queried.
>
> The bug is visible on FreeBSD 4.2-STABLE client which cannot ls The
> mounted file system (NFS v2 is fine since it does not have ACCESS).
> There is no related log entry in the 2.2.19pre7 change log. I did not
> check Linux 2.4.0, 2.4.0-acX or 2.4.1-preX either.

To summarise the summary of the summary:
I stuffed up when I tried to interpret the error, but after much
sensible correction, here is a patch. Please try it, and suggest any
other errs that should be tested for (or maybe we should invert the
sense of the test, and test for error codes that ACCESS is allowed to
return.
2.4.0 seems to get it right.

NeilBrown

--- ./fs/nfsd/vfs.c 2001/01/10 05:03:28 1.11
+++ ./fs/nfsd/vfs.c 2001/01/24 06:02:01
@@ -448,7 +448,9 @@
error = nfsd_permission(export, dentry, (map->how | NO_OWNER_OVERRIDE));
if (error == 0)
result |= map->access;
- else if ((error == nfserr_perm) || (error == nfserr_acces)) {
+ else if ((error == nfserr_perm) ||
+ (error == nfserr_acces) ||
+ (error == nfserr_rofs)) {
/*
* This access type is denyed; but the
* access query itself succeeds.

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