From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43667) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bEy6A-0008Ve-GH for qemu-devel@nongnu.org; Mon, 20 Jun 2016 08:14:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bEy66-0007kv-A9 for qemu-devel@nongnu.org; Mon, 20 Jun 2016 08:14:38 -0400 Date: Mon, 20 Jun 2016 13:14:31 +0100 From: Stefan Hajnoczi Message-ID: <20160620121431.GF14100@stefanha-x1.localdomain> References: <1465939839-30097-1-git-send-email-eblake@redhat.com> <1465939839-30097-6-git-send-email-eblake@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="pyE8wggRBhVBcj8z" Content-Disposition: inline In-Reply-To: <1465939839-30097-6-git-send-email-eblake@redhat.com> Subject: Re: [Qemu-devel] [Qemu-block] [PATCH v2 05/17] nbd: Advertise realistic limits to block layer List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: qemu-devel@nongnu.org, kwolf@redhat.com, Paolo Bonzini , qemu-block@nongnu.org, Max Reitz --pyE8wggRBhVBcj8z Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jun 14, 2016 at 03:30:27PM -0600, Eric Blake wrote: > We were basing the advertisement of maximum discard and transfer > length off of UINT32_MAX, but since the rest of the block layer > has signed int limits on a transaction, nothing could ever reach > that maximum, and we risk overflowing an int once things are > converted to byte-based rather than sector-based limits. What's > more, we DO have a much smaller limit: both the current kernel > and qemu-nbd have a hard limit of 32M on a read or write > transaction, and while they may also permit up to a full 32 bits > on a discard transaction, the upstream NBD protocol is proposing > wording that without any explicit advertisement otherwise, > clients should limit ALL requests to the same limits as read and > write, even though the other requests do not actually require as > many bytes across the wire. So the better limit to tell the > block layer is 32M for both values. >=20 > Signed-off-by: Eric Blake >=20 > --- > v2: new patch > --- > block/nbd.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) Reviewed-by: Stefan Hajnoczi --pyE8wggRBhVBcj8z Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJXZ94nAAoJEJykq7OBq3PIIUYIAIlG+N6ZRNPeoCdgXcqJW/H2 UF0Syh1fvZzQTlJXdIbyoCdRnGokKmwjUsDPfnYbzka/SrFDDXsj02KbKUjs6UQR zDZStKWT7uEuVNYa+vTDfdL6LkXnlFoKR+z6FAygkep055qagu8HyWjroxMwN2rn zZ1pDRZhZBmAxLYgMx4qpLUA7vX1c379VFJ/WNJtHKU0sRlQJXqE3GCPA0tj8TRc 8RCWbjf2E0pnqOqvTwVh553Kbe94LBwdnYaBd8KYwSxrEk/HhWH8dOiH2xHbh+Me YZEdBP+cpge5RxRhalXpsjN0O/slnWCduI+8OY5L9eRFXCi7WFa6YHsUTcWZWi4= =CoJK -----END PGP SIGNATURE----- --pyE8wggRBhVBcj8z--