Re: NFS-mounted, read-only /dev unusable in 2.6
From: Neil Brown
Date: Wed Aug 04 2004 - 06:04:23 EST
On Wednesday August 4, fsteiner-mail@xxxxxxxxxxxxxx wrote:
> Neil Brown wrote:
>
> >>But I just tried to reproduce this on 2.6.7-rc2 (it's what my
> >>workstation happens to be running) and I can't. I can mount an
> >>nfs-exported /dev from both 2.4 and 2.6 servers read-only and
> >>I can open devices on that read-only mount just fine.
> >
> >
> > Yes, it was a bug in the NFS server in 2.6 that was fixed fairly
> > recently.
>
> Hi Neil,
>
> it still occurs in 2.6.8rc3 in some way:
.... It looks like it was *so* recent that I haven't actually
submitted the patch yet :-(
I think someone reported it, I sent them a patch, and never got a
confirmation that it worked (or missed it if I did) so the patch
didn't progres..
Try the following.
Thanks,
NeilBrown
### Diffstat output
./fs/nfsd/vfs.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff ./fs/nfsd/vfs.c~current~ ./fs/nfsd/vfs.c
--- ./fs/nfsd/vfs.c~current~ 2004-07-26 09:54:15.000000000 +1000
+++ ./fs/nfsd/vfs.c 2004-07-23 13:37:38.000000000 +1000
@@ -376,12 +376,13 @@ static struct accessmap nfs3_anyaccess[]
* to the server to check for access for things like /dev/null
* (which really, the server doesn't care about). So
* We provide simple access checking for them, looking
- * mainly at mode bits
+ * mainly at mode bits, and we make sure to ignore read-only
+ * filesystem checks
*/
{ NFS3_ACCESS_READ, MAY_READ },
{ NFS3_ACCESS_EXECUTE, MAY_EXEC },
- { NFS3_ACCESS_MODIFY, MAY_WRITE },
- { NFS3_ACCESS_EXTEND, MAY_WRITE },
+ { NFS3_ACCESS_MODIFY, MAY_WRITE|MAY_LOCAL_ACCESS },
+ { NFS3_ACCESS_EXTEND, MAY_WRITE|MAY_LOCAL_ACCESS },
{ 0, 0 }
};
-
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/