Date: Wed, 10 Apr 2013 22:01:10 +0300 From: Konstantin Belousov <kostikbel@gmail.com> To: Matthew Rezny <mrezny@hexaneinc.com> Cc: freebsd-standards@FreeBSD.org Subject: Re: standards/177742: conflict of dd's bs= option with use of conv=sparse Message-ID: <20130410190110.GM2930@kib.kiev.ua> In-Reply-To: <201304101410.r3AEA1vH044880@freefall.freebsd.org> References: <201304101410.r3AEA1vH044880@freefall.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--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 <mrezny@hexaneinc.com> > 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--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20130410190110.GM2930>