From owner-freebsd-fs@FreeBSD.ORG Wed Jan 16 03:10:41 2013 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id EB3EBB97 for ; Wed, 16 Jan 2013 03:10:41 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from esa-annu.net.uoguelph.ca (esa-annu.mail.uoguelph.ca [131.104.91.36]) by mx1.freebsd.org (Postfix) with ESMTP id A298C1E1 for ; Wed, 16 Jan 2013 03:10:41 +0000 (UTC) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AqAEAPIZ9lCDaFvO/2dsb2JhbABFhjq3aXOCHgEBAQMBAQEBIAQnIAsFFg4KERkCBB8GAQkmBggHBAEcBIdmAwkGDKYQgkCGXA2HfowIgQiDFYETA4hhhieEVliBVoEcihuFEoMTgVE1 X-IronPort-AV: E=Sophos;i="4.84,476,1355115600"; d="scan'208";a="9262898" Received: from erie.cs.uoguelph.ca (HELO zcs3.mail.uoguelph.ca) ([131.104.91.206]) by esa-annu.net.uoguelph.ca with ESMTP; 15 Jan 2013 22:10:35 -0500 Received: from zcs3.mail.uoguelph.ca (localhost.localdomain [127.0.0.1]) by zcs3.mail.uoguelph.ca (Postfix) with ESMTP id 5E9ABB3F2E; Tue, 15 Jan 2013 22:10:35 -0500 (EST) Date: Tue, 15 Jan 2013 22:10:35 -0500 (EST) From: Rick Macklem To: Sergey Kandaurov Message-ID: <980540815.2029630.1358305835362.JavaMail.root@erie.cs.uoguelph.ca> In-Reply-To: Subject: Re: getcwd lies on/under nfs4-mounted zfs dataset MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_2029629_336101775.1358305835359" X-Originating-IP: [172.17.91.201] X-Mailer: Zimbra 6.0.10_GA_2692 (ZimbraWebClient - FF3.0 (Win)/6.0.10_GA_2692) Cc: freebsd-fs@freebsd.org X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Jan 2013 03:10:42 -0000 ------=_Part_2029629_336101775.1358305835359 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit pluknet@gmail.com wrote: > Hi. > > We stuck with the problem getting wrong current directory path > when sitting on/under zfs dataset filesystem mounted over NFSv4. > Both nfs server and client are 10.0-CURRENT from December or so. > > The component path "user3" unexpectedly appears to be "." (dot). > nfs-client:/home/user3 # pwd > /home/. > nfs-client:/home/user3/var/run # pwd > /home/./var/run > Yep, it was broken for UFS too. I think the attached patch for the client might fix it. (It fixes a trivial test case for UFS, but I haven't gone through the code to check if it might break something else.) I vaguely recall bumping into a non-FreeBSD server that only returned the Mounted_on_fileno attribute for mount points at a testing bakeathon and hacking around the problem that caused. (I think that hack made it into head, oops.;-) So, I wouldn't test this patch for a production type system, but if you can test it, that would be great. Sorry about the breakage, rick > nfs-client:~ # procstat -f 3225 > PID COMM FD T V FLAGS REF OFFSET PRO NAME > 3225 a.out text v r r-------- - - - /home/./var/a.out > 3225 a.out ctty v c rw------- - - - /dev/pts/2 > 3225 a.out cwd v d r-------- - - - /home/./var > 3225 a.out root v d r-------- - - - / > > The used setup follows. > > 1. NFS Server with local ZFS: > # cat /etc/exports > V4: / -sec=sys > > # zfs list > pool1 10.4M 122G 580K /pool1 > pool1/user3 on /pool1/user3 (zfs, NFS exported, local, nfsv4acls) > > Exports list on localhost: > /pool1/user3 109.70.28.0 > /pool1 109.70.28.0 > > # zfs get sharenfs pool1/user3 > NAME PROPERTY VALUE SOURCE > pool1/user3 sharenfs -alldirs -maproot=root -network=109.70.28.0/24 > local > > 2. pool1 is mounted on NFSv4 client: > nfs-server:/pool1 on /home (nfs, noatime, nfsv4acls) > > So that on NFS client the "pool1/user3" dataset comes at /home/user3. > / - ufs > /home - zpool-over-nfsv4 > /home/user3 - zfs dataset "pool1/user3" > > At the same time it works as expected when we're not on zfs dataset, > but directly on its parent zfs pool (also over NFSv4), e.g. > nfs-client:/home/non_dataset_dir # pwd > /home/non_dataset_dir > > The ls command works as expected: > nfs-client:/# ls -dl /home/user3/var/ > drwxrwxrwt+ 6 root wheel 6 Jan 10 16:19 /home/user3/var/ > > -- > wbr, > pluknet > _______________________________________________ > freebsd-fs@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-fs > To unsubscribe, send any mail to "freebsd-fs-unsubscribe@freebsd.org" ------=_Part_2029629_336101775.1358305835359 Content-Type: text/x-patch; name=client-getcwd.patch Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename=client-getcwd.patch LS0tIGZzL25mcy9uZnNwcm90by5oLnNhdjIJMjAxMy0wMS0xNSAyMTozNDo0OS4wMDAwMDAwMDAg LTA1MDAKKysrIGZzL25mcy9uZnNwcm90by5oCTIwMTMtMDEtMTUgMjE6MzY6NTUuMDAwMDAwMDAw IC0wNTAwCkBAIC05ODQsNyArOTg0LDggQEAgc3RydWN0IG5mc3YzX3NhdHRyIHsKICAJTkZTQVRU UkJNX1NQQUNFVVNFRCB8CQkJCQkJXAogIAlORlNBVFRSQk1fVElNRUFDQ0VTUyB8CQkJCQkJXAog IAlORlNBVFRSQk1fVElNRU1FVEFEQVRBIHwJCQkJCVwKLSAJTkZTQVRUUkJNX1RJTUVNT0RJRlkp CisgCU5GU0FUVFJCTV9USU1FTU9ESUZZIHwJCQkJCQlcCisJTkZTQVRUUkJNX01PVU5URURPTkZJ TEVJRCkKIAogLyoKICAqIFN1YnNldCBvZiB0aGUgYWJvdmUgdGhhdCB0aGUgV3JpdGUgUlBDIGdl dHMuCi0tLSBmcy9uZnMvbmZzX2NvbW1vbnN1YnMuYy5zYXYyCTIwMTMtMDEtMTUgMjE6Mzg6NTMu MDAwMDAwMDAwIC0wNTAwCisrKyBmcy9uZnMvbmZzX2NvbW1vbnN1YnMuYwkyMDEzLTAxLTE1IDIx OjQwOjA0LjA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