From patchwork Mon Mar 28 10:43:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Denis V. Lunev" X-Patchwork-Id: 602437 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3qYVt86hM1z9sBf for ; Mon, 28 Mar 2016 21:45:20 +1100 (AEDT) Received: from localhost ([::1]:40165 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1akUff-0001f4-8O for incoming@patchwork.ozlabs.org; Mon, 28 Mar 2016 06:45:19 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48352) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1akUeE-0007WB-4u for qemu-devel@nongnu.org; Mon, 28 Mar 2016 06:43:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1akUeA-0002bu-US for qemu-devel@nongnu.org; Mon, 28 Mar 2016 06:43:50 -0400 Received: from mailhub.sw.ru ([195.214.232.25]:38762 helo=relay.sw.ru) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1akUeA-0002aY-I7 for qemu-devel@nongnu.org; Mon, 28 Mar 2016 06:43:46 -0400 Received: from irbis.sw.ru ([10.30.2.139]) by relay.sw.ru (8.13.4/8.13.4) with ESMTP id u2SAhIO0030189; Mon, 28 Mar 2016 13:43:26 +0300 (MSK) From: "Denis V. Lunev" To: nbd-general@lists.sourceforge.net, qemu-devel@nongnu.org Date: Mon, 28 Mar 2016 13:43:17 +0300 Message-Id: <1459161798-32120-3-git-send-email-den@openvz.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1459161798-32120-1-git-send-email-den@openvz.org> References: <1459161798-32120-1-git-send-email-den@openvz.org> X-detected-operating-system: by eggs.gnu.org: OpenBSD 3.x X-Received-From: 195.214.232.25 Cc: den@openvz.org, Pavel Borzenkov , Alex Bligh , Wouter Verhelst Subject: [Qemu-devel] [PATCH 2/3] NBD proto: document additional error conditions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Pavel Borzenkov 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 Reviewed-by: Roman Kagan Signed-off-by: Denis V. Lunev CC: Wouter Verhelst CC: Eric Blake CC: Alex Bligh Reviewed-by: Eric Blake --- 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.