Date: Tue, 15 Jan 2013 22:10:35 -0500 (EST) From: Rick Macklem <rmacklem@uoguelph.ca> To: Sergey Kandaurov <pluknet@gmail.com> Cc: freebsd-fs@freebsd.org Subject: Re: getcwd lies on/under nfs4-mounted zfs dataset Message-ID: <980540815.2029630.1358305835362.JavaMail.root@erie.cs.uoguelph.ca> In-Reply-To: <CAE-mSOJk1HbxvF=ZpoSP21b9j65qMov=AE-OM6wcUkbadQeZbw@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --] 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" [-- Attachment #2 --] --- fs/nfs/nfsproto.h.sav2 2013-01-15 21:34:49.000000000 -0500 +++ fs/nfs/nfsproto.h 2013-01-15 21:36:55.000000000 -0500 @@ -984,7 +984,8 @@ struct nfsv3_sattr { NFSATTRBM_SPACEUSED | \ NFSATTRBM_TIMEACCESS | \ NFSATTRBM_TIMEMETADATA | \ - NFSATTRBM_TIMEMODIFY) + NFSATTRBM_TIMEMODIFY | \ + NFSATTRBM_MOUNTEDONFILEID) /* * Subset of the above that the Write RPC gets. --- fs/nfs/nfs_commonsubs.c.sav2 2013-01-15 21:38:53.000000000 -0500 +++ fs/nfs/nfs_commonsubs.c 2013-01-15 21:40:04.000000000 -0500 @@ -1726,6 +1726,7 @@ nfsv4_loadattr(struct nfsrv_descript *nd if (*tl++) printf("NFSv4 mounted on fileid > 32bits\n"); nap->na_mntonfileno = thyp; + nap->na_fileid = nap->na_mntonfileno; } attrsum += NFSX_HYPER; break;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?980540815.2029630.1358305835362.JavaMail.root>
