2009-11-03 23:49:59

by Jon Forrest

[permalink] [raw]
Subject: Question About nfs3 vs. nfs4 Semantics On Sun 7310 Server

(Sorry about posting to both nfs lists. I'm not
sure whether what I'm describing is an nfs3 or
nfs4 problem so I posted to both).

I've discovered what might be a bug in our Sun 7310 storage server.
This using the latest software release (2009.09.01.1.0,1-1.3).

The problem has to do with accessing a NFS share on the 7310
from a Linux 2.6.18-128.1.14.el5 kernel (a.k.a. CentOS 5.3).

The example below shows that certain behavior depends on whether
the NFS share is mounted using NFS3 or NFS4. This isn't a
surprise. What is a surprise is that both appear to have
problems.

The shell prompts in the example should clearly show which
is which (I've added line numbers in the left column for clarity).

1 [nfs3]# touch x
2 [nfs3]# cp -p x y
3 cp: preserving permissions for `y': Operation not supported
4 cp: preserving ACL for `y': Operation not supported
5 [nfs3]# ls -l
6 total 1
7 -rw-r--r--+ 1 root root 0 Nov 3 14:46 x
8 -rw-r--r--+ 1 root root 0 Nov 3 14:46 y
9 [nfs3]# cd /tmp/x/home/jlforrest/nfs4
10 [nfs4]# touch x
11 [nfs4]# cp -p x y
12 [nfs4]# ls -l
13 total 1
14 -rw-rw-r-- 1 nobody nobody 0 Nov 3 14:48 x
15 -rw-rw-r-- 1 nobody nobody 0 Nov 3 14:48 y

To summarize, I have the same share mounted in two different
places, one using NFS3 and one using NFS4. The share has "root
access" enabled. The examples are being run by root.
In both cases, I'm simply creating a file, and then
using 'cp -p' to copy the file to another file in the same directory.

The message on line 3 is surprising because this command is being
run by root. The message on line 4 isn't surprising because NFS3
doesn't really support ACLs. If only line 4 were generated then
this would make sense. Note that the file protection and ownership
shown in lines 7-8 are correct.

On line 11, using the NFS4 mount point, no error messages are produced
when doing the copy. This is what I'd expect using either version of
NFS. However, notice that the file protection is different than
in the first example, but more importantly, notice that the file
ownership is wrong. Again, this is being run by root on a "root
access" enabled share.

Not being an NFS expert, I'm not if I'm seeing incorrect
behavior but it sure looks like it to me.

Cordially,
--
Jon Forrest
Research Computing Support
College of Chemistry
173 Tan Hall
University of California Berkeley
Berkeley, CA
94720-1460
510-643-1032
jlforrest-TVLZxgkOlNX2fBVCVOL8/[email protected]