From owner-freebsd-net@freebsd.org Fri Dec 2 19:23:12 2016 Return-Path: Delivered-To: freebsd-net@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 48E30C6352B for ; Fri, 2 Dec 2016 19:23:12 +0000 (UTC) (envelope-from vicepresjoebiden@gmail.com) Received: from mail-vk0-x231.google.com (mail-vk0-x231.google.com [IPv6:2607:f8b0:400c:c05::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0494714A0 for ; Fri, 2 Dec 2016 19:23:12 +0000 (UTC) (envelope-from vicepresjoebiden@gmail.com) Received: by mail-vk0-x231.google.com with SMTP id 137so151266687vkl.0 for ; Fri, 02 Dec 2016 11:23:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to; bh=QENxzR8pEvUAFkQsEopK4+/FQIvLa913g3yaIgNaIzI=; b=JGZ5SvIMmw6SKXATJXTW/dQBG6A/fnlOpU5U3yLCo7Evfc9ON0IGISDG4CMPutPx8f 2HBDAD6wpyloCAEiSkxNH9MdjI5ArpzIx0txWmhsaEaVA0PPCz+i/o3Zte2RqSLek/Ie v134/hhbBIMQ4iBRTXoZ6qUlSdVulywl5h+YBFfp3Q99MmkJ6oSdyNfELH7jERkUcJof 4XsZgcrAvhJD0UP+Kjgjdp/Vip/RqzSTlj+qS3im3/KwCPfRY1ZSt77vFD++q0piEDtR jqfcrXfa+shvugKxzkD4oddTpswYAN2m+OSeKG+OChC1GfViwqCZPv6ig68GxAXb2TSO S6uw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=QENxzR8pEvUAFkQsEopK4+/FQIvLa913g3yaIgNaIzI=; b=E7sAlJJNVbdxeXjGt8lu/G9GnJm6XQTD5niVxUtur6hji6v2hIShH6QQnSHx7wwKF3 DlvJ6LkmmE0wyprWTVRgvbGsJ9wSYtAFzBxWskCIs5NL2HxdDQ9wKgu56QGvDp69ueKc ILWkGuPSSBKCS6zHURlAm4d9f03m4jH3pQMsocD0QzUJRY1zZk9us4KZzJIyPiR6VMmf ji0MUvOpIh7i+KZOpp3tc5k3xDSPnhrGvD6QlrNYd8ThUb9WgjgLoTZxJNXJUP3DilqV U+XOh13tQ8fX1Mkcp3mVdZ3j5iJQ2Itn9He665LBzlbgrx0JH+n4vCxcidZxrj5YjhkM r1yQ== X-Gm-Message-State: AKaTC0062dSNc1dPPqXyiyr3bdIDqUMuyDF0Zn9drTZiuPxoEmLNywoEEsZu4i7rqJZFGlJ4H7H4wJNIFfODuw== X-Received: by 10.31.162.72 with SMTP id l69mr17712754vke.123.1480706590993; Fri, 02 Dec 2016 11:23:10 -0800 (PST) MIME-Version: 1.0 Received: by 10.176.0.103 with HTTP; Fri, 2 Dec 2016 11:23:10 -0800 (PST) From: Jordan Ladora Date: Fri, 2 Dec 2016 12:23:10 -0700 Message-ID: Subject: File duplication on NFSv4 exported ZFS filesystems to centos client To: freebsd-net@freebsd.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 19:23:12 -0000 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=3Dtcp,nodev,noexec,nosuid 10.0.100.100:/zpool_nfsv4 /zpool_nfsv4 mount -t nfs4 -o rw,intr,hard,proto=3Dtcp,nodev,noexec,nosuid 10.0.100.100:/zpool_nfsv4/zfs2 /zpool_nfsv4_zfs2 mount -t nfs4 -o rw,intr,hard,proto=3Dtcp,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 =E2=80=98testfile=E2=80=99 can be manipul= ated 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...