From owner-freebsd-net@freebsd.org Fri Dec 2 23:36:28 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 B0A86C639A0 for ; Fri, 2 Dec 2016 23:36:28 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from na01-by2-obe.outbound.protection.outlook.com (mail-by2on0099.outbound.protection.outlook.com [207.46.100.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "Microsoft IT SSL SHA2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 69D2FB10 for ; Fri, 2 Dec 2016 23:36:27 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from YTXPR01MB0189.CANPRD01.PROD.OUTLOOK.COM (10.165.218.133) by YTXPR01MB0189.CANPRD01.PROD.OUTLOOK.COM (10.165.218.133) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.747.13; Fri, 2 Dec 2016 22:04:41 +0000 Received: from YTXPR01MB0189.CANPRD01.PROD.OUTLOOK.COM ([10.165.218.133]) by YTXPR01MB0189.CANPRD01.PROD.OUTLOOK.COM ([10.165.218.133]) with mapi id 15.01.0747.018; Fri, 2 Dec 2016 22:04:41 +0000 From: Rick Macklem To: Jordan Ladora , "freebsd-net@freebsd.org" Subject: Re: File duplication on NFSv4 exported ZFS filesystems to centos client Thread-Topic: File duplication on NFSv4 exported ZFS filesystems to centos client Thread-Index: AQHSTNGLvid/pn4fzkGYDop7p0LBoKD1MwKF Date: Fri, 2 Dec 2016 22:04:41 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=rmacklem@uoguelph.ca; x-ms-office365-filtering-correlation-id: a3480c52-fefb-4790-7827-08d41aff3789 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:YTXPR01MB0189; x-microsoft-exchange-diagnostics: 1; YTXPR01MB0189; 7:TGwD8nSTzKwYoqs/nvmpM+vOgApSS7KjnVQpm9So7UMu38BWwpk6yzaEy4v8q7fdRBoBWHZ3xU7zwuX7SoE49HXDtm1Klrb0il297BCBnj62skeG2E0C6zcJ0dXT5ViYM+iKZzsYzB7E0XkiII0Eo56YnZJP5Mxeo4gAqY7uQdX3i9O5Tp68kXzxeAvARWBIahi16qvl+A9Y+5eFNxYKeyoGtdWnrW7OZ8tmfPpEwezFawQZntW1aUeWVjmWzrSfOwZFoAJTEf+xKzSXNWzYCXOugK4poVnmPyMfchslKXNmPJP1cWia3VFh8INxMzf8iMYcQULlxg6hwlYXmEMSwMXLMpRnWskHPdixtHgboXGR0efZrOJETjmzd7vHtYpl5OM1fCEH1MW/7ldfLJVBzWQ1NGIP4/8f2jWB1VP81mwX32gZo4opxtZTlWF5KMUFa5yMyTyZ7eQCCsnd5/7QFw== x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(158342451672863)(235228084354710); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040375)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6041248)(20161123564025)(20161123562025)(20161123555025)(20161123560025)(2016111802025)(6072148)(6043046); SRVR:YTXPR01MB0189; BCL:0; PCL:0; RULEID:; SRVR:YTXPR01MB0189; x-forefront-prvs: 0144B30E41 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6009001)(7916002)(189002)(24454002)(199003)(122556002)(86362001)(97736004)(92566002)(2501003)(2900100001)(74482002)(74316002)(101416001)(9686002)(3280700002)(189998001)(107886002)(102836003)(305945005)(68736007)(81156014)(3660700001)(8936002)(81166006)(2906002)(38730400001)(106116001)(106356001)(105586002)(50986999)(8676002)(7846002)(54356999)(76176999)(39060400001)(39410400001)(2950100002)(77096006)(33656002)(229853002)(5660300001)(7696004)(39450400002)(5001770100001)(6506006); DIR:OUT; SFP:1101; SCL:1; SRVR:YTXPR01MB0189; H:YTXPR01MB0189.CANPRD01.PROD.OUTLOOK.COM; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; received-spf: None (protection.outlook.com: uoguelph.ca does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: uoguelph.ca X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Dec 2016 22:04:41.6040 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: be62a12b-2cad-49a1-a5fa-85f4f3156a7d X-MS-Exchange-Transport-CrossTenantHeadersStamped: YTXPR01MB0189 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 23:36:28 -0000 Jordan Ladora wrote: >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 > - I'll call this mount #2. >mount -t nfs4 -o rw,intr,hard,proto=3Dtcp,nodev,noexec,nosuid >10.0.100.100:/zpool_nfsv4/zfs2 >/zpool_nfsv4_zfs2 - I'll call this mount #3. >mount -t nfs4 -o rw,intr,hard,proto=3Dtcp,nodev,noexec,nosuid >10.0.100.100:/zpool_nfsv4/zfs3 >/zpool_nfsv4_zfs3 By default (unlike NFSv3) NFSv4 mounts the entire tree of file systems under the mount point and not just the file system being mounted. You have two choices: 1 - Don't do mount #2 or mount #3. The first mount should allow you to access /zpool_nfsv4/zfs2 and /zpool_nfsv4/zfs3 with the addition mount= s. OR 2 - Turn of the "whole tree" behaviour on the server via: # sysctl vfs.nfsd.mirrormnt=3D0 on the FreeBSD server. (I know, mirrormnt is a weird name for it, but that is what Linux used, so.= .. I guess it means "mirror the tree of mounted file systems on the server to= the clients".) [stuff snipped] >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. What you did definitely had the same file systems mounted multiple times, so I suspect that is what caused this behaviour. rick