qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Denis V. Lunev" <den@openvz.org>
To: nbd-general@lists.sourceforge.net, qemu-devel@nongnu.org
Cc: den@openvz.org, Pavel Borzenkov <pborzenkov@virtuozzo.com>,
	Alex Bligh <alex@alex.org.uk>, Wouter Verhelst <w@uter.be>
Subject: [Qemu-devel] [PATCH 2/3] NBD proto: document additional error conditions
Date: Mon, 28 Mar 2016 13:43:17 +0300	[thread overview]
Message-ID: <1459161798-32120-3-git-send-email-den@openvz.org> (raw)
In-Reply-To: <1459161798-32120-1-git-send-email-den@openvz.org>

From: Pavel Borzenkov <pborzenkov@virtuozzo.com>

It is unclear what the behaviour of a server should be if it receives
an unknown command. Similar uncertainty exists for command flags.

Make it explicit that the server should return EINVAL in all such cases.

Signed-off-by: Pavel Borzenkov <pborzenkov@virtuozzo.com>
Reviewed-by: Roman Kagan <rkagan@virtuozzo.com>
Signed-off-by: Denis V. Lunev <den@openvz.org>
CC: Wouter Verhelst <w@uter.be>
CC: Eric Blake <eblake@redhat.com>
CC: Alex Bligh <alex@alex.org.uk>
---
 doc/proto.md | 7 +++++++
 1 file changed, 7 insertions(+)

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 request 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 flag. It
+also SHOULD return `EINVAL` if it receives a request with a flag not explicitly
+documented as applicable to the given request.
+
 Which error to return in any other case is not specified by the NBD
 protocol.
 
-- 
2.1.4

  parent reply	other threads:[~2016-03-28 10:43 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-28 10:43 [Qemu-devel] [PATCH 0/3] Fix some ambiguities in the NBD protocol Denis V. Lunev
2016-03-28 10:43 ` [Qemu-devel] [PATCH 1/3] NBD proto: forbid TRIM command without negotiation Denis V. Lunev
2016-03-28 13:00   ` Eric Blake
2016-03-29  7:22     ` [Qemu-devel] [Nbd] " Wouter Verhelst
2016-03-29 13:54       ` Eric Blake
2016-03-28 10:43 ` Denis V. Lunev [this message]
2016-03-28 13:05   ` [Qemu-devel] [PATCH 2/3] NBD proto: document additional error conditions Eric Blake
2016-03-28 10:43 ` [Qemu-devel] [PATCH 3/3] NBD proto: add "Command flags" section Denis V. Lunev
2016-03-28 13:45   ` Eric Blake
2016-03-29  7:34     ` [Qemu-devel] [Nbd] " Wouter Verhelst
2016-03-29 16:01   ` [Qemu-devel] " Eric Blake
2016-03-29 16:03     ` Eric Blake

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1459161798-32120-3-git-send-email-den@openvz.org \
    --to=den@openvz.org \
    --cc=alex@alex.org.uk \
    --cc=nbd-general@lists.sourceforge.net \
    --cc=pborzenkov@virtuozzo.com \
    --cc=qemu-devel@nongnu.org \
    --cc=w@uter.be \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).