From owner-freebsd-current@FreeBSD.ORG Sun Sep 22 20:57:12 2013 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 67343B9B for ; Sun, 22 Sep 2013 20:57:12 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net (lor.one-eyed-alien.net [69.66.77.232]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B47CB2635 for ; Sun, 22 Sep 2013 20:57:11 +0000 (UTC) Received: from lor.one-eyed-alien.net (localhost [127.0.0.1]) by lor.one-eyed-alien.net (8.14.5/8.14.5) with ESMTP id r8MKv5JE027366; Sun, 22 Sep 2013 15:57:05 -0500 (CDT) (envelope-from brooks@lor.one-eyed-alien.net) Received: (from brooks@localhost) by lor.one-eyed-alien.net (8.14.7/8.14.7/Submit) id r8MKv5R9027365; Sun, 22 Sep 2013 15:57:05 -0500 (CDT) (envelope-from brooks) Date: Sun, 22 Sep 2013 15:57:05 -0500 From: Brooks Davis To: Matthias Andree Subject: Re: [PATCH] mtree should not output size if the file is not a regular file Message-ID: <20130922205705.GF62197@lor.one-eyed-alien.net> References: <20130909235122.4A9C997129@rebar.astron.com> <522EB562.8060501@gmx.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="tMbDGjvJuJijemkf" Content-Disposition: inline In-Reply-To: <522EB562.8060501@gmx.de> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-current@freebsd.org X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 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: Sun, 22 Sep 2013 20:57:12 -0000 --tMbDGjvJuJijemkf Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Sep 10, 2013 at 08:00:02AM +0200, Matthias Andree wrote: > Am 10.09.2013 01:51, schrieb Christos Zoulas: > > On Sep 10, 1:21am, des@des.no (=3D?utf-8?Q?Dag-Erling_Sm=3DC3=3DB8rgra= v?=3D) wrote: > > -- Subject: Re: [PATCH] mtree should not output size if the file is not= a reg > >=20 > > | Roll a large tarball (e.g. a complete FreeBSD installation). Copy it= to > > | different machines with different filesystems. Untar and run mtree on > > | the result. Notice that you get different output on each machine > > | because they report different sizes for directories; one might report > > | the actual on-disk size (which might vary depending on past contents) > > | while the other might report the number of entries. > >=20 > > Yes, I agree. I would like to note that the current NetBSD code looks l= ike: > >=20 > > if (keys & F_SIZE && > > (flavor !=3D F_NETBSD6 || S_ISREG(p->fts_statp->st_mode))) > >=20 > > which means that F_NETBSD6 did not print this, and we recently changed > > it to print the size for compatibility with F_FREEBSD9... We also made > > the default F_MTREE format to print the size. So I guess the thing to > > do is change the code to: > >=20 > > if (keys & F_SIZE && > > (flavor =3D=3D F_FREEBSD9 || S_ISREG(p->fts_statp->st_mode))) >=20 > Uh, does that flavor =3D=3D F_FREEBSD9 solve a real problem? Or is it ju= st > to reflect some syntax without proper semantics? >=20 > Or is this just gratuitious because someone else does nonsense we need > to do it, too? >=20 > Or is it required to cater for expectations on the other end (when > reading such an mtree description)? >=20 > If not, let's just drop the size where it's meaningless. It's meant for > the next major update, after all. If necessary, bump the OSREVISION. The intent of flavors is to allow the comparison of mtree output across versions (where reasonably practical). For things like showing size on all file types, it's trivial to get mostly right so I feel it's useful. For things like the nanosecond formatting bug fixed long ago in FreeBSD and recently in NetBSD, the only option is breaking compatibility so that's what was done. I agree with the argument that we shouldn't print sizes for most non-regular files and think we should make this change before FreeBSD 10.0. -- Brooks --tMbDGjvJuJijemkf Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iD8DBQFSP1mgXY6L6fI4GtQRArmPAJ9SJ7kzLue73t5dT5B1FdAy9DkX+wCeMvjc y7JIkWuKtsgN5UZ/4KkFYmE= =XEFo -----END PGP SIGNATURE----- --tMbDGjvJuJijemkf--