[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[PATCH] doc: Clarify NBD_CMD_READ payload on error



Commit e6c6fb39 clarified that a payload for the reply to NBD_CMD_READ
must not be sent if the error field was set (which matches existing
nbd-server and qemu-nbd behavior; I'm also in the process of patching
nbdkit to comply).  But it missed another spot in the document, which
if read in isolation, results in the wrong behavior.

Signed-off-by: Eric Blake <eblake@redhat.com>
---
 doc/proto.md | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/doc/proto.md b/doc/proto.md
index f6a9063..88154f1 100644
--- a/doc/proto.md
+++ b/doc/proto.md
@@ -340,7 +340,8 @@ follows:
 S: 32 bits, 0x67446698, magic (`NBD_REPLY_MAGIC`)  
 S: 32 bits, error (MAY be zero)  
 S: 64 bits, handle  
-S: (*length* bytes of data if the request is of type `NBD_CMD_READ`)  
+S: (*length* bytes of data if the request is of type `NBD_CMD_READ` and
+    *error* is zero)  

 #### Terminating the transmission phase

-- 
2.13.6


Reply to: