From owner-freebsd-standards@FreeBSD.ORG Wed Apr 10 19:01:21 2013 Return-Path: Delivered-To: freebsd-standards@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C8567880 for ; Wed, 10 Apr 2013 19:01:21 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id 6D2A424C for ; Wed, 10 Apr 2013 19:01:21 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.6/8.14.6) with ESMTP id r3AJ1Anl044868; Wed, 10 Apr 2013 22:01:10 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.8.2 kib.kiev.ua r3AJ1Anl044868 Received: (from kostik@localhost) by tom.home (8.14.6/8.14.6/Submit) id r3AJ1A7J044867; Wed, 10 Apr 2013 22:01:10 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 10 Apr 2013 22:01:10 +0300 From: Konstantin Belousov To: Matthew Rezny Subject: Re: standards/177742: conflict of dd's bs= option with use of conv=sparse Message-ID: <20130410190110.GM2930@kib.kiev.ua> References: <201304101410.r3AEA1vH044880@freefall.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="bZ2MuwyI/0uB8yuJ" Content-Disposition: inline In-Reply-To: <201304101410.r3AEA1vH044880@freefall.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: freebsd-standards@FreeBSD.org X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Apr 2013 19:01:21 -0000 --bZ2MuwyI/0uB8yuJ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Apr 10, 2013 at 02:10:01PM +0000, Matthew Rezny wrote: > The following reply was made to PR standards/177742; it has been noted by= GNATS. >=20 > From: Matthew Rezny > To: bug-followup@FreeBSD.org > Cc: =20 > Subject: Re: standards/177742: conflict of dd's bs=3D option with use of > conv=3Dsparse > Date: Wed, 10 Apr 2013 15:31:08 +0200 >=20 > The patch I suggested got a little messed up by the web form, and it > also contained a typo. Further, I had neglected to consider the > C_BS flag itself should be present after masking off the few allowed > flags, so the patch should be amended as such follows. > =20 > if (ddflags & C_BS) { > out.dbcnt =3D in.dbcnt; > - dd_out(1); > + dd_out((ddflags & !(C_NOERROR | C_NOTRUNC | C_SYNC)) =3D=3D C_BS); > in.dbcnt =3D 0; > continue; > } > =20 > This patch has been tested to confirm conv=3Dsparse now works as expected > with bs=3D set. No other conversions have been checked with the bs=3D > option and from reading the code I don't think they will. I somehow followed what you wrote. Still, I think your patch is not correct. Its result is always using the block coalescing mode there. The issue is that the '!' operator result is defined to be either 0 or 1, which mask and-ed with ddflags never could be equal to the C_BS =3D=3D 4. You probably mean '~' ? In fact, the test in the containing if () means that C_BS is guaranteed to be set there. So my question is, do you want to explicitely check that no other flags are set, except noerror, notrunc, sync and bs ? Or is it yet another bug ? --bZ2MuwyI/0uB8yuJ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQIcBAEBAgAGBQJRZbb1AAoJEJDCuSvBvK1BO8UP/1yyeFvOhJJWE+6kd0S8sHUq 0KCIG1h//CyNlHgeSvzWlFdklzCkd08f3/v4lqgrwhsDA7P/39jh4BE/9FD5hM3P izjkTCUKUenKb3SoW+aK6++k3DSx8eXSBCEB5Omon++uZDJkYsPhO6stZ+5MlMEQ 3UYSDZVUUpkVe8m2S6bmDKnx19bRoY4QpDHWr2T0WyfV/gJFvg47L8netIZMA5Tl EBFFVQQAmB2RuktKDBjZazy2C7K7+0500A7VYQjJT8iOCZh8CDE8NjLDSpcPGdcn A62L0a0c+JeiSkfq0ShgtnPcfcF56SnOOt/p/fodOFSuq3bNCSwKFWB/wLfN4RCE rNf8sx/t5gBwwL+Gc1z4ksd9J1Ik77amK0vNnOEvQHdQsaduVUHZ/3CKOR2nUyjL 7Ge3yNk4H3tF0sw/eEzJGmYTJPIFiMJUV+euuU7xHEVIkBQPPdq4mQNe8FXuhkcb sg1CG7npqWqPwEj1c0xKXQp8vLj1ux002MHpxFUMiW2MBApMo/rZ4d2ktIYBQu4/ g3EI75jUulvzy5e6VOd3GEaenKSrmBK5AhocLm8Vd0tCRlVHDeGIIOR8aDdTJYeG HhVC1l/tbnc7UuQ/ReHIe19/XkQEQgFW+EZ+pUqst2Q/7+9358OEXyYS31Gr+ZC+ UGL+syBA6IijCv3VGLYI =OIM8 -----END PGP SIGNATURE----- --bZ2MuwyI/0uB8yuJ--