From owner-svn-src-head@freebsd.org Sat Feb 20 00:40:38 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F3E21AAE79A; Sat, 20 Feb 2016 00:40:37 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id D204C13DC; Sat, 20 Feb 2016 00:40:37 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id CC32E17B1; Sat, 20 Feb 2016 00:40:37 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 8474718B9C; Sat, 20 Feb 2016 00:40:37 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id eP8e3Ikb-B_D; Sat, 20 Feb 2016 00:40:34 +0000 (UTC) Subject: Re: svn commit: r295800 - head/usr.bin/cap_mkdb DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 3E6EA18B96 To: Stefan Esser , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201602190842.u1J8gDOc015177@repo.freebsd.org> From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc X-Enigmail-Draft-Status: N1110 Organization: FreeBSD Message-ID: <56C7B60E.8080002@FreeBSD.org> Date: Fri, 19 Feb 2016 16:40:46 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <201602190842.u1J8gDOc015177@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="nepOibrStrSBLkOxNqg3SCE5Mv0cEvcD0" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Feb 2016 00:40:38 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --nepOibrStrSBLkOxNqg3SCE5Mv0cEvcD0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 2/19/2016 12:42 AM, Stefan Esser wrote: > Author: se > Date: Fri Feb 19 08:42:13 2016 > New Revision: 295800 > URL: https://svnweb.freebsd.org/changeset/base/295800 >=20 > Log: > Remove O_SYNC from the options passed to dbmopen(). Uh, this is a full revert of r293312's changes to cap_mkdb which were made for good reason. So this seems simply wrong without a better fix. > =20 > The output file is created as a temporary file that is moved over the= > existing file after completion. Thus there is no need to immediately > flush all created db records to the temporary file. This is not right either. Depending on the use of soft updates / journaling the data and metadata (file name / rename) may be written at different times. It is entirely possible to get a renamed file with no or junk content without an fsync. That's exactly what r293312 mentions in its commit message. > =20 > This speeds up creation of the termcap db by a factor of 40 on my > ZFS based /etc filesytem (from 25 seconds to 0.6 seconds). > =20 > I have compared multiple output files created with and without O_SYNC= > and they came out identical each time. Nonetheless it might be best > to MFC this change and the similar one for services_mkdb (r295465) at= > the same time when the changes to hash.c in review D5186 are merged. > =20 > MFC: 1 week >=20 > Modified: > head/usr.bin/cap_mkdb/cap_mkdb.c >=20 > Modified: head/usr.bin/cap_mkdb/cap_mkdb.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/usr.bin/cap_mkdb/cap_mkdb.c Fri Feb 19 08:41:47 2016 (r295799)= > +++ head/usr.bin/cap_mkdb/cap_mkdb.c Fri Feb 19 08:42:13 2016 (r295800)= > @@ -119,7 +119,7 @@ main(int argc, char *argv[]) > (void)snprintf(buf, sizeof(buf), "%s.db", capname ? capname : *argv);= > if ((capname =3D strdup(buf)) =3D=3D NULL) > errx(1, "strdup failed"); > - if ((capdbp =3D dbopen(capname, O_CREAT | O_TRUNC | O_RDWR | O_SYNC, > + if ((capdbp =3D dbopen(capname, O_CREAT | O_TRUNC | O_RDWR, > DEFFILEMODE, DB_HASH, &openinfo)) =3D=3D NULL) > err(1, "%s", buf); > =20 >=20 --=20 Regards, Bryan Drewery --nepOibrStrSBLkOxNqg3SCE5Mv0cEvcD0 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJWx7YOAAoJEDXXcbtuRpfP0eoIAKJjU/UcXWCvLBsNGRdxbyOM 5uk9H2Aue4TPjEST4SXuFE49mdWsqty5dC36UKxVyQONOUOI+BGRBApxPYqWRYRi K+DPz9FmBNbKgxv/De2FrF2zHabPg/f+PyMxCu/BnwtMui5SWYMmeHSeLV5G3KD6 RBm5/xAga2J4EtZR3NnIL/kIASFOOrExgVdC+7ln46WQFPomA5rkDfeYVGud4w05 V2puH9vnCtY6EaInRp1lAgR0eczsVV5EX0jqw1GOlgXRmUZYWoVi4HmT6UogLTbH v6rVwurm2OumY7OpmBzP6ZJXBQHOM5YZFOKaZQnbvpZLwZb7pUiEzmZEbT/vD+8= =aFoF -----END PGP SIGNATURE----- --nepOibrStrSBLkOxNqg3SCE5Mv0cEvcD0--