Skip to contentSkip to conversation

problems using devices via nfsvers3 with 2.6.6. and 2.6.7

DISCUSSION Alexander Bergolth 2 participants 3 messages Jul 6, 2004 – Jul 23, 2004

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi!

I'm getting "permission denied" errors when trying to access devices from a 2.6 client that are mounted via nfsvers3 and exported read-only by the server. Using nfsvers2 or a 2.4 kernel doesn't show this error.

I could reproduce this with kernel 2.6.6-1.435.2.3 (from FC-2) and with kernel 2.6.7-1.456_4.rhfc2.at (from ATrpms).

Any hints?

---------- Client using kernel 2.6.6-1.435.2.3 ----------

# mount -oro,nfsvers=3 ariel:/dev /mnt
# ls -l /mnt/null
crw-rw-rw-  1 root root 1, 3 Sep 15  2003 /mnt/null
# echo test > /mnt/null ; echo $?
-bash: /mnt/null: Permission denied
1
# umount /mnt
# mount -oro,nfsvers=2 ariel:/dev /mnt
# echo test > /mnt/null ; echo $?
0

---------- Client using 2.4.22 ----------

# mount -oro,nfsvers=3 ariel:/dev /mnt
# ls -l /mnt/null
ls: /mnt/null: Input/output error
crw-rw-rw-  1 root root 1, 3 Sep 15  2003 /mnt/null
# echo test > /mnt/null ; echo $?
0

---------- Server (2.4.22) ----------

# cat /etc/exports
/dev client1(ro,async,no_root_squash) client2(ro,async,no_root_squash)

--leo

Signature · 11 lines
-------------------------------------------------------
Alexander (Leo) Bergolth          [email protected]
WU-Wien - Zentrum fuer Informatikdienste - Projektbuero


-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - digital self defense, top technical experts, no vendor pitches, unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
NFS maillist  -  [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs
#1 lore raw
Quoted 1 line · Alexander Bergolth

I'm getting "permission denied" errors when trying to access devices from a 2.6 client that are mounted via nfsvers3 and exported read-only by the server. Using nfsvers2 or a 2.4 kernel doesn't show this error.

Some additional notes:
Writing to /mnt/null (which corresponds to /dev/null) only produces an error if the filesystem is exported read-only by the server. If the server exports it read-write, writing to the device works as expected, even if it is mounted read-only by the client.

--leo

Signature · 11 lines
-------------------------------------------------------
Alexander (Leo) Bergolth          [email protected]
WU-Wien - Zentrum fuer Informatikdienste - Projektbuero


-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - digital self defense, top technical experts, no vendor pitches, unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
NFS maillist  -  [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs
#2 lore raw
In reply to Alexander Bergolth
Quoted 10 lines · On Tuesday July 6, [email protected] wrote:

Hi!

I'm getting "permission denied" errors when trying to access devices from a 2.6 client that are mounted via nfsvers3 and exported read-only by the server. Using nfsvers2 or a 2.4 kernel doesn't show this error.

I could reproduce this with kernel 2.6.6-1.435.2.3 (from FC-2) and with kernel 2.6.7-1.456_4.rhfc2.at (from ATrpms).

Any hints?

Yes. Try the following patch. It should fix the problem.

NeilBrown

### Diffstat output

 ./fs/nfsd/vfs.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
fs/nfsd/vfs.c renamed from fs/nfsd/vfs.c~current~ +4 -3
diff ./fs/nfsd/vfs.c~current~ ./fs/nfsd/vfs.c
@@ -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				}
 };

-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs