From owner-freebsd-current@FreeBSD.ORG Mon Aug 27 18:12:20 2012 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0BDFA1065797; Mon, 27 Aug 2012 18:12:20 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 960438FC0A; Mon, 27 Aug 2012 18:12:19 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q7RICRen008841; Mon, 27 Aug 2012 21:12:27 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q7RICENO059007; Mon, 27 Aug 2012 21:12:14 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q7RICERa059006; Mon, 27 Aug 2012 21:12:14 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 27 Aug 2012 21:12:14 +0300 From: Konstantin Belousov To: Bernhard Fr?hlich Message-ID: <20120827181214.GD33100@deviant.kiev.zoral.com.ua> References: <20120812132047.GA33526@psconsult.nl> <20120820123142.GY33100@deviant.kiev.zoral.com.ua> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="jWQLpvAamslfamA3" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.0 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: Garrett Cooper , Current FreeBSD , Paul Schenkeveld Subject: Re: make package fails in chroot: tar: getvfsbyname failed: No such file or directory X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Aug 2012 18:12:20 -0000 --jWQLpvAamslfamA3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Aug 27, 2012 at 05:28:09PM +0200, Bernhard Fr?hlich wrote: > On Mon, Aug 20, 2012 at 2:31 PM, Konstantin Belousov > wrote: > > On Mon, Aug 20, 2012 at 01:42:31PM +0200, Bernhard Fr?hlich wrote: > >> On Sun, Aug 19, 2012 at 10:01 PM, Tim Kientzle wrot= e: > >> > > >> > On Aug 19, 2012, at 12:17 PM, Garrett Cooper wrote: > >> > > >> >> On Sun, Aug 19, 2012 at 9:45 AM, Tim Kientzle wr= ote: > >> >>> > >> >>> On Aug 12, 2012, at 6:20 AM, Paul Schenkeveld wrote: > >> >>> > >> >>>> Hi, > >> >>>> > >> >>>> I have a wrapper script that builds packages in a chroot environm= ent > >> >>>> which happily runs on release 6 thru 9 and earlier 10 but fails w= ith: > >> >>>> > >> >>>> tar: getvfsbyname failed: No such file or directory > >> >>>> > >> >>>> on a recent -CURRENT. > >> >>> > >> >>> libarchive does do an initial getvfsbyname() when you ask it > >> >>> to traverse a directory tree so that it can accurately handle later > >> >>> requests about mountpoints and filesystem types. This code > >> >>> is admittedly a little intricate. > >> >> > >> >> The problem most likely is the fact that all mountpoints are > >> >> exposed via chroot, thus, if it's checking to see if a mountpoint > >> >> exists, it may exist outside of the chroot. > >> >> > >> > > >> > I reviewed the code to refresh my memory. Some > >> > of what I said before was not quite right. > >> > > >> > Libarchive's directory traversal tracks information about > >> > the filesystem type so that clients such as bsdtar can > >> > efficiently skip synthetic filesystems (/dev or /proc) or > >> > network filesystems (NFS or SMB mounts). > >> > > >> > The net effect is something like this: > >> > > >> > For each file: > >> > stat() or lstat() or fstat() the file > >> > look up dev number in an internal cache > >> > if the dev number is new: > >> > fstatfs() the open fd to get the FS name > >> > getvfsbyname() to identify the FS type > >> > > >> > Unless there's a logic error in libarchive itself, this > >> > would suggest that somehow fstatfs() is returning > >> > a filesystem type that getvfsbyname() can't > >> > identify. > >> > > >> > Paul: > >> > What filesystem are you using? > >> > > >> > What does "mount" show? > >> > > >> > Does it work outside the chroot? > >> > >> I also see the same on the redports.org build machines. > >> It builds within a jail there which is completely on a tmpfs. > >> Interestinly everything is fine with a 10-CURRENT/amd64 > >> jail but it breaks in a 10-CURRENT/i386 jail. Both are > >> running on the same 10-CURRENT/amd64 which is > >> around 2 months old. > >> > >> https://redports.org/buildarchive/20120814130205-56327/ > > > > Try this. >=20 > I've seen that it was committed to head in the meantime so > I gave that a try. The problem still persists. >=20 > https://redports.org/~decke/20120827152217-19891-54992/expat-2.0.1_2.log Are you sure that you tested the right kernel ? You may use the following test program to verify. Compile it on 32bit system. Run it like this: =2E/getvfsbyname devfs ufs nfs On patched kernel, I get sandy% ./getvfsbyname devfs ufs nfs = ~ name devfs typenum 113 ref 2 flags 0x480000 name ufs typenum 53 ref 1 flags 0x0 name nfs typenum 58 ref 4 flags 0x20000 On unpatched machine, the result is ooma32% ./getvfsbyname devfs ufs nfs ~/build/bsd/DEV/stuff/te= sts getvfsbyname: getvfsbyname("devfs"): No such file or directory getvfsbyname: getvfsbyname("ufs"): No such file or directory getvfsbyname: getvfsbyname("nfs"): No such file or directory --jWQLpvAamslfamA3 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAlA7uH4ACgkQC3+MBN1Mb4jswwCg2zA2MWxJdUNHas7hGTK7e6HO 0NYAoNlWkA+iEF8Vf7OjugemJLw9oU/A =BL2n -----END PGP SIGNATURE----- --jWQLpvAamslfamA3--