From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47258) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b5Y0T-0003nG-NJ for qemu-devel@nongnu.org; Wed, 25 May 2016 08:33:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b5Y0P-0001sD-DQ for qemu-devel@nongnu.org; Wed, 25 May 2016 08:33:48 -0400 Date: Wed, 25 May 2016 14:33:35 +0200 From: Kevin Wolf Message-ID: <20160525123335.GE4815@noname.redhat.com> References: <1464173965-9694-1-git-send-email-eblake@redhat.com> <57458BC3.6000606@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="kXdP64Ggrk/fb43R" Content-Disposition: inline In-Reply-To: <57458BC3.6000606@redhat.com> Subject: Re: [Qemu-devel] [PATCH v2] nbd: Don't trim unrequested bytes List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: qemu-devel@nongnu.org, pbonzini@redhat.com, qemu-stable@nongnu.org, qemu-block@nongnu.org --kXdP64Ggrk/fb43R Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Am 25.05.2016 um 13:25 hat Eric Blake geschrieben: > On 05/25/2016 04:59 AM, Eric Blake wrote: > > + /* Ignore unaligned head or tail, until block layer adds byte > > + * interface */ > > + if (request.len >=3D BDRV_SECTOR_SIZE) { > > + request.len -=3D (request.from + request.len) % BDRV_SECTO= R_SIZE; > > + ret =3D blk_co_discard(exp->blk, > > + DIV_ROUND_UP(request.from + exp->dev_= offset, > > + BDRV_SECTOR_SIZE), > > + request.len / BDRV_SECTOR_SIZE); >=20 > This can end up calling blk_co_discard(, , 0) - do we need to audit > whether all underlying drivers handle a 0-length request, and/or > special-case this in blk_co_discard() to be an explicit no-op? Auditing shouldn't be too hard as we don't have many drivers that support the operation in the first place. In any case, it might be useful to add a qemu-iotest case that tries all kinds of operations with a zero length. Kevin --kXdP64Ggrk/fb43R Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQIcBAEBAgAGBQJXRZufAAoJEH8JsnLIjy/WK+YP/A1CRC89rfg+5AuLwc/1bNxh pn5mLaX7WhfJgQUhg2TZbSo4mR2BzNmzAV4Z1T5G1Bt37+DSUH/BJ0ynE8Yk4zyn AQ8IFnuGrZGhcXwcAE4svi0NOUmdIZgVZNsnmPu6Yb/AY9KCWnqVfR6/BFkj8bQ9 BMkKjVZaQYTCiHsT3wQbvfS2DUvBBbug2xuZdVwDGmh9tx5P434EUEDouJ2iCrhA 0PE6v4kvkF1/daiXig5P6tQdQ/Jtx0K2SPdjlwzxClPDShu3EsrH+l3D+g0+uVhW a+ynHbWTl6RNAzf32eIxCTGwx9tZULG0l6AooBg0kWieFQm9mRhCUJs+sjbcuoJ7 AwFQTtgeXr15gYw+2nv4f+EXjgLSZ94grteeiEGoGSaNOz46o05qMvrZpvZsqf/z VzWXIpV/GpTXmvozqzfyE8IqzlnnVLiUmSRj0NmqfJM9FmYgSeUtTq/cuUc0FPwr ciMNVPCi18qcmFChyyLHN/ovPpvALWlly4+ZlN9q3owrCvCwX02Gsi7pNR8lao+7 /noVF33TxoQyHAvhbz/qAfq2VjfSLEXfZxOFjqOpY9wdMauurA/58G9lgrqN5Gti TofCefSppSY7KgrDyNsHMqDT8K3yYJo5kO+d6FiTu3uTtAuIW6sNHqFZCYrAlj6n 4KjtA4fYz1UgfXs0BjP9 =l+j9 -----END PGP SIGNATURE----- --kXdP64Ggrk/fb43R--