File duplication on NFSv4 exported ZFS filesystems to centos client
Jordan Ladora
vicepresjoebiden at gmail.com
Fri Dec 2 19:23:12 UTC 2016
Curious phenomenon of file pseudo-dup with exported ZFS filesystems on
FreeBSD 10.3-REL NFSv4 export to a centos7 client.
*FreeBSD server-*
zpool create zpool_nfsv4 ...
zfs create zpool_nfsv4/zfs2
zfs create zpool_nfsv4/zfs3
/etc/exports-
V4: /
/zpool_nfsv4
/zpool_nfsv4/zfs2
/zpool_nfsv4/zfs3
zfs unshare -a
*Centos client-*
mkdir /zpool_nfsv4
mkdir /zpool_nfsv4_zfs2
mkdir /zpool_nfsv4_zfs3
mount -t nfs4 -o rw,intr,hard,proto=tcp,nodev,noexec,nosuid
10.0.100.100:/zpool_nfsv4
/zpool_nfsv4
mount -t nfs4 -o rw,intr,hard,proto=tcp,nodev,noexec,nosuid
10.0.100.100:/zpool_nfsv4/zfs2
/zpool_nfsv4_zfs2
mount -t nfs4 -o rw,intr,hard,proto=tcp,nodev,noexec,nosuid
10.0.100.100:/zpool_nfsv4/zfs3
/zpool_nfsv4_zfs3
The FreeBSD share and centos client have the same username (nfsuser),
groupname, and user:group IDs, which also owns the exported /zpool_nfsv4,
so UID/GIDs map correctly on the client and permissions work fine.
The unexpected behavior happens when the user touches a file on the
client's share of either /zpool_nfsv4/zfs2 or /zpool_nfsv4/zfs3-
sudo -u nfsuser touch /zpool_nfs4_zfs2/testfile # centos client
...this new file then also appears immediately on the client's share mount
at-
/zpool_nfs4_zfs3/testfile
...but not at /zpool_nfs4 (the top-level zfs). It is not duplicated on the
server and there it only appears [in the correct location] at-
/zpool_nfs4/zfs2/testfile # freebsd server
If I unmount the share and remount it, it looks the same (you still see the
duplicate file on the client) and ‘testfile’ can be manipulated on the
client from either location.
This also doesn't happen if touching a file on the top-level dir
(/zpool_nfsv4) on the client (in other words, there is no duplication seen
on the client if nfsuser touches e.g. /zpool_nfsv4/testfile).
This seems similar to this (https://serverfault.com/quest
ions/535318/creating-two-nfs-shares-from-same-server-but-
when-mounted-both-point-to-same-d) thread with NFSv4 exports on a centos
server, but I cannot find anything similar to what I see here with a
FreeBSD NFSv4 server.
It seems to me that two of the zfs filesystems (zfs1 and zfs2) are mapping
to the same place on the client, but I'm not sure how to deal with this...
More information about the freebsd-net
mailing list