From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45543) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1akWrg-0006rV-Ju for qemu-devel@nongnu.org; Mon, 28 Mar 2016 09:05:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1akWrc-0003XI-MG for qemu-devel@nongnu.org; Mon, 28 Mar 2016 09:05:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56245) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1akWrc-0003XA-Er for qemu-devel@nongnu.org; Mon, 28 Mar 2016 09:05:48 -0400 References: <1459161798-32120-1-git-send-email-den@openvz.org> <1459161798-32120-3-git-send-email-den@openvz.org> From: Eric Blake Message-ID: <56F92C29.30808@redhat.com> Date: Mon, 28 Mar 2016 07:05:45 -0600 MIME-Version: 1.0 In-Reply-To: <1459161798-32120-3-git-send-email-den@openvz.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="s9PQ7mQe6C83lSXkXW0fBaw8MH3gNrrVU" Subject: Re: [Qemu-devel] [PATCH 2/3] NBD proto: document additional error conditions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Denis V. Lunev" , nbd-general@lists.sourceforge.net, qemu-devel@nongnu.org Cc: Wouter Verhelst , Pavel Borzenkov , Alex Bligh This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --s9PQ7mQe6C83lSXkXW0fBaw8MH3gNrrVU Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 03/28/2016 04:43 AM, Denis V. Lunev wrote: > From: Pavel Borzenkov >=20 > It is unclear what the behaviour of a server should be if it receives > an unknown command. Similar uncertainty exists for command flags. >=20 > Make it explicit that the server should return EINVAL in all such cases= =2E I'd go one step further and document that for backwards compatibility, clients should not rely on this particular error. >=20 > Signed-off-by: Pavel Borzenkov > Reviewed-by: Roman Kagan > Signed-off-by: Denis V. Lunev > CC: Wouter Verhelst > CC: Eric Blake > CC: Alex Bligh > --- > doc/proto.md | 7 +++++++ > 1 file changed, 7 insertions(+) >=20 > diff --git a/doc/proto.md b/doc/proto.md > index d54ed19..036d6d9 100644 > --- a/doc/proto.md > +++ b/doc/proto.md > @@ -512,6 +512,13 @@ return `EINVAL` if it receives a read or trim requ= est including one or > more sectors beyond the size of the device. It also SHOULD map the > `EDQUOT` and `EFBIG` errors to `ENOSPC`. Finally, it SHOULD return > `EPERM` if it receives a write or trim request on a read-only export. > + > +The server SHOULD return `EINVAL` if it receives an unknown command. > + > +The server SHOULD return `EINVAL` if it receives an unknown command fl= ag. It > +also SHOULD return `EINVAL` if it receives a request with a flag not e= xplicitly > +documented as applicable to the given request. In other words, while this is good for the server side, we have proven that existing server implementations did not follow this, and therefore it would probably be good to add a sentence along the lines of: However, clients should not rely on this particular error, as some historical servers silently ignored invalid commands or flags. But as what you have proposed is a strict improvement, Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --s9PQ7mQe6C83lSXkXW0fBaw8MH3gNrrVU 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 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJW+SwpAAoJEKeha0olJ0NqNFMIAKhAoZ5cnTBfd7hx62B4MYpe CXUJ67xMbRVAniYqocW441cCFA8HM060cHQ7StukFsmYbHmyqkXnrDdSjXo/jMrZ Ev7FKJzC+QRdBigaeh5wG13mqKlU9dNUl8xOVigPViH9WeAWiftxZ0LZUhnQ2Iwm ENxCPkppY1HV49aOuG4ewOOyW476YYp+1TQ+7YXOnFNv8r/Y5PmTnBhbIkXAawTB dYcWZckdmL+tjDQy24isYoqG4GMNb/bZdlYDjSkwZAU2qnSJBZQh6AUNc1J1f05i vUJKt11XM9dFDrC2oK1d7skGLgAqSYNpv88r5JMorx4dnLF66oDq4tiBFDNAgUc= =ZdkQ -----END PGP SIGNATURE----- --s9PQ7mQe6C83lSXkXW0fBaw8MH3gNrrVU--