My suggestion would be to ask nfs@lists.sourceforge.net. Trond and Chuck Lever both seem to hang out there, and discuss changes to the linux nfs client. Alternately, the source might have some interesting comments. This might be an interesting start. I'll admit I did a quick check, and didn't find anything specific regarding snapshot support.
http://lxr.linux.no/source/fs/nfs/?v=2.6.18
-Blake
On 11/6/06, Stephen C. Losen scl@sasha.acc.virginia.edu wrote:
We installed the latest kernel update for Red Hat FC5 (forgot the kernel version number) and we noticed a nifty new NFS client feature. The kernel is "snapshot aware" which means that when you "stat()" something in a snapshot, the device number is different from the live filesystem. Furthermore, different snapshots have different device numbers.
I looked at the Linux source code in the above URL and found what may explain the behavior. The getattr() call receives a struct with a "rdev" (remove device?) field. I think this is a remote device number that is supplied by the NFS server (filer). The Linux NFS client code uses the rdev field to set a "fsys" field, which I think is a local (client) filesystem identifier. I suspect the "fsys" field is what stat() returns in the st_dev field of a "struct stat".
I suspect that when a NFS client does a getattr() on an object in a snapshot that the filer returns a different "rdev" value than it returns for objects in the live filesystem. Does anyone know if this is indeed how a filer behaves?
Perhaps the "fsys" field is traditionally determined by the NFS client at mount time and everything below a mount point (including snapshots) gets the same "fsys". Perhaps Linux is now deriving the fsys field from the rdev field returned by the filer.
Are there any NFS experts out there who can comment further?
I did some more experiments with a Linux NFS client running an earlier kernel. According to stat each mount point has a unique device number and all objects (including those in snapshots) have this device number.
With the current kernel (2.6.18-1.2200.fc5smp) things are different. As I said before, the device number changes between the live filesystem and snapshots. Furthermore, if I mount two subtrees of the same netapp volume on two different mount points such as this:
mount filer:/vol/vol0/x /mnt/x
mount filer:/vol/vol0/y /mnt/y
then stat shows the same device number for both /mnt/x and /mnt/y.
On the old kernel the device numbers are different.
Steve Losen scl@virginia.edu phone: 434-924-0640
University of Virginia ITC Unix Support