Date: Thu, 14 Mar 2013 11:08:47 +0200 From: Konstantin Belousov <kostikbel@gmail.com> To: Noskov Ilia <phantom@phantom.su> Cc: freebsd-fs@freebsd.org Subject: Re: should vn_fullpath1() ever return a path with "." in it? Message-ID: <20130314090847.GH3794@kib.kiev.ua> In-Reply-To: <51417C47.8010304@phantom.su> References: <1208475167.3432384.1362099531469.JavaMail.root@erie.cs.uoguelph.ca> <51417C47.8010304@phantom.su>
next in thread | previous in thread | raw e-mail | index | archive | help
--0y/VvS0T6GrSShsQ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Mar 14, 2013 at 11:29:11AM +0400, Noskov Ilia wrote: > Strange behavior on nfs-client after apply this patch: >=20 > sysctl debug.disablecwd=3D0 > sysctl debug.disablefullpath=3D0 >=20 > # mount -v -t nfs > 192.168.168.1:/pool on /home (nfs, noatime, nfsv4acls, fsid=20 > 02ff003a3a000000) > # ls /home | wc -l > 4946 > # cd /home/user6308/.ro > # time pwd > /home/user6308/.ro > 0.008u 0.269s 0:08.47 3.0% 4+157k 0+0io 0pf+0w > # ktrace -t+ -i pwd >=20 >=20 > ktrace.out is big (1MB). Attach or not? >=20 >=20 >=20 > A small piece of trace: > 19527 pwd CALL=20 > mmap(0,0x400000,0x3<PROT_READ|PROT_WRITE>,0x1002<MAP_PRIVATE|MAP_ANON>,0x= ffffffff,0) > 19527 pwd RET mmap 34376515584/0x801000000 > 19527 pwd CALL __getcwd(0x801006400,0x400) > 19527 pwd NAMI ".." > 19527 pwd NAMI ".." > 19527 pwd RET __getcwd -1 errno 2 No such file or directory > 19527 pwd CALL stat(0x800947a14,0x7fffffffd940) > 19527 pwd NAMI "/" > 19527 pwd STRU struct stat {dev=3D98, ino=3D2, mode=3Ddrwxr-xr-x = ,=20 > nlink=3D19, uid=3D0, gid=3D0, rdev=3D2120, atime=3D1363244893, stime=3D13= 62653279,=20 > ctime=3D1362653279, birthtime=3D1200836451, size=3D1024, blksize=3D16384,= =20 > blocks=3D4, flags=3D0x0 } > 19527 pwd RET stat 0 > 19527 pwd CALL lstat(0x80094779c,0x7fffffffd940) > 19527 pwd NAMI "." > 19527 pwd STRU struct stat {dev=3D1230702064, ino=3D145,=20 > mode=3Ddrwxr-xr-x , nlink=3D2, uid=3D0, gid=3D0, rdev=3D4294967295,=20 > atime=3D1363244672.246785874, stime=3D1363244792.864201338,=20 > ctime=3D1363244792.864201338, birthtime=3D-1, size=3D3, blksize=3D4096,= =20 > blocks=3D3, flags=3D0x0 } > 19527 pwd RET lstat 0 > 19527 pwd CALL openat(0xffffff9c,0x80094779b,0x100000,0x2) > 19527 pwd NAMI ".." > 19527 pwd RET openat 3 > 19527 pwd CALL fstat(0x3,0x7fffffffd880) > 19527 pwd STRU struct stat {dev=3D1230702064, ino=3D4,=20 > mode=3Ddrwxr-xr-x , nlink=3D9, uid=3D0, gid=3D0, rdev=3D4294967295,=20 > atime=3D1363244665.232140704, stime=3D1363010116.496298252,=20 > ctime=3D1363010116.496298252, birthtime=3D-1, size=3D14, blksize=3D4096,= =20 > blocks=3D3, flags=3D0x0 } > 19527 pwd RET fstat 0 > 19527 pwd CALL fcntl(0x3,F_SETFD,FD_CLOEXEC) > 19527 pwd RET fcntl 0 > 19527 pwd CALL fstatfs(0x3,0x7fffffffd660) > 19527 pwd RET fstatfs 0 > 19527 pwd CALL fstat(0x3,0x7fffffffd940) > 19527 pwd STRU struct stat {dev=3D1230702064, ino=3D4,=20 > mode=3Ddrwxr-xr-x , nlink=3D9, uid=3D0, gid=3D0, rdev=3D4294967295,=20 > atime=3D1363244665.232140704, stime=3D1363010116.496298252,=20 > ctime=3D1363010116.496298252, birthtime=3D-1, size=3D14, blksize=3D4096,= =20 > blocks=3D3, flags=3D0x0 } > 19527 pwd RET fstat 0 > 19527 pwd CALL getdirentries(0x3,0x801018000,0x1000,0x8010160a8) > 19527 pwd RET getdirentries 4096/0x1000 > 19527 pwd CALL fstat(0x3,0x7fffffffd940) > 19527 pwd STRU struct stat {dev=3D1230702064, ino=3D4,=20 > mode=3Ddrwxr-xr-x , nlink=3D9, uid=3D0, gid=3D0, rdev=3D4294967295,=20 > atime=3D1363244665.232140704, stime=3D1363010116.496298252,=20 > ctime=3D1363010116.496298252, birthtime=3D-1, size=3D14, blksize=3D4096,= =20 > blocks=3D3, flags=3D0x0 } > 19527 pwd RET fstat 0 > 19527 pwd CALL openat(0x3,0x80094779b,0x100000,0) > 19527 pwd NAMI ".." > 19527 pwd RET openat 4 > [..............................] > 19527 pwd CALL madvise(0x801016000,0x1000,MADV_FREE) > 19527 pwd RET madvise 0 > 19527 pwd CALL madvise(0x801018000,0x2000,MADV_FREE) > 19527 pwd RET madvise 0 > 19527 pwd CALL close(0x3) > 19527 pwd RET close 0 > 19527 pwd CALL fstat(0x4,0x7fffffffd880) > 19527 pwd STRU struct stat {dev=3D973143810, ino=3D4,=20 > mode=3Ddrwxr-xr-x , nlink=3D4948, uid=3D0, gid=3D0, rdev=3D4294967295,=20 > atime=3D1363244767.460164771, stime=3D1363172100.380266923,=20 > ctime=3D1363172100.380266923, birthtime=3D-1, size=3D4948, blksize=3D4096= ,=20 > blocks=3D713, flags=3D0x0 } > 19527 pwd RET fstat 0 > 19527 pwd CALL fcntl(0x4,F_SETFD,FD_CLOEXEC) > 19527 pwd RET fcntl 0 > 19527 pwd CALL fstatfs(0x4,0x7fffffffd660) > 19527 pwd RET fstatfs 0 > 19527 pwd CALL fstat(0x4,0x7fffffffd940) > 19527 pwd STRU struct stat {dev=3D973143810, ino=3D4,=20 > mode=3Ddrwxr-xr-x , nlink=3D4948, uid=3D0, gid=3D0, rdev=3D4294967295,=20 > atime=3D1363244767.460164771, stime=3D1363172100.380266923,=20 > ctime=3D1363172100.380266923, birthtime=3D-1, size=3D4948, blksize=3D4096= ,=20 > blocks=3D713, flags=3D0x0 } > 19527 pwd RET fstat 0 > 19527 pwd CALL getdirentries(0x4,0x801018000,0x1000,0x8010160a8) > 19527 pwd RET getdirentries 4096/0x1000 > 19527 pwd CALL fstatat(0x4,0x801018030,0x7fffffffd940,0x200) > 19527 pwd NAMI "user6158" > 19527 pwd STRU struct stat {dev=3D1774902232, ino=3D4,=20 > mode=3Ddrwxr-xr-x , nlink=3D9, uid=3D0, gid=3D0, rdev=3D4294967295,=20 > atime=3D1363009687.040357529, stime=3D1363010116.496298252,=20 > ctime=3D1363010116.496298252, birthtime=3D-1, size=3D14, blksize=3D4096,= =20 > blocks=3D3, flags=3D0x0 } > 19527 pwd RET fstatat 0 > 19527 pwd CALL fstatat(0x4,0x80101804c,0x7fffffffd940,0x200) > 19527 pwd NAMI "user2289" > 19527 pwd STRU struct stat {dev=3D1988229825, ino=3D4,=20 > mode=3Ddrwxr-xr-x , nlink=3D9, uid=3D0, gid=3D0, rdev=3D4294967295,=20 > atime=3D1363009687.040357529, stime=3D1363010116.496298252,=20 > ctime=3D1363010116.496298252, birthtime=3D-1, size=3D14, blksize=3D4096,= =20 > blocks=3D3, flags=3D0x0 } > 19527 pwd RET fstatat 0 > 19527 pwd CALL fstatat(0x4,0x801018068,0x7fffffffd940,0x200) > 19527 pwd NAMI "user4761" > 19527 pwd STRU struct stat {dev=3D2438657130, ino=3D4,=20 > mode=3Ddrwxr-xr-x , nlink=3D9, uid=3D0, gid=3D0, rdev=3D4294967295,=20 > atime=3D1363009687.040357529, stime=3D1363010116.496298252,=20 > ctime=3D1363010116.496298252, birthtime=3D-1, size=3D14, blksize=3D4096,= =20 > blocks=3D3, flags=3D0x0 } > 19527 pwd RET fstatat 0 > 19527 pwd CALL fstatat(0x4,0x801018084,0x7fffffffd940,0x200) > 19527 pwd NAMI "user6055" > [.........................................] >=20 > and next get stat of all directories in /home Slightly different version of the patch was committed as r247560. The situation could only happen if the parent directory contains the "." entry with inode number equal to the inode number of the subdirectory. Can you confirm that this is your case ? --0y/VvS0T6GrSShsQ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQIcBAEBAgAGBQJRQZOfAAoJEJDCuSvBvK1Bu9IP/iRFexlxYkdp5x5FeZuzAt7A 3Bu4LKb8V3eaMEniTOIRQff8eO8GsA3Ti3s9F3ZHN6BiCriy5DrWeuxNJtAa6YmA GnU7r16aROpzJ8Z0CtTQoabKPNjCdqy9LG6jeiFlhemaG2tgpz2N6BX/MuJbrW0F CJIsw+QozZ/koqgXpFwvkb+kjXydGm41YZJxEkdtrIecampWzWunJD19cjD3sSrC rEYggRinQK/EQUrRBIidxWu9qKrW+WrZy4ePP7jjuIjr9//vYXIQnJre+BiYdqjL Ihwi5fJ91wOU1vNr/7VEN/MOyISqZjXkINdvtKOWWClX/ahC06JcWoPECNVM8S3/ F3eUNyECyxkSKNnHTRseAqVZBOUpE7ulr6fSxxGiVB1SCYZwmfXq7IODV0mazDI9 w/03KBCSca0HScX5j2cYrKooS9tthdZiAp2f4LRfHef1fnaesInfDmDHkff4pxs4 QsjdlYLHe/ke0XFzZsR8zcdtdX6HmdzcCJLjMERvEyZ+8KPqb75/ANZb4aLK+UE1 FUYec0QDJ/DsPqbucMbOr4uXiZHHGrwYP4yETATlh9QTxLBZSSNgK50qCEvTf1ek metx0YXNscOtTg+ZFY5qJtu4g8J/dMkWlUExzQ7FYIN9vfaGH5TRlfq+Qd0iGuRL nluNA4JJ4YVEg27W1ZbP =+vHn -----END PGP SIGNATURE----- --0y/VvS0T6GrSShsQ--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20130314090847.GH3794>