All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nbd: Zero from and len fields in NBD_CMD_DISCONNECT.
@ 2014-05-16 23:43 Hani Benhabiles
       [not found] ` <CAECXXi4_RJ-yk8Ct=sPPe-pq=shdU-4cKvRTT3yNvsoY42-8_Q@mail.gmail.com>
  0 siblings, 1 reply; 5+ messages in thread
From: Hani Benhabiles @ 2014-05-16 23:43 UTC (permalink / raw)
  To: Paul.Clements; +Cc: nbd-general, linux-kernel

Len field is already set to zero, but not the from field which is sent as
0xfffffffffffffe00. This makes no sense, and may cause confuse server
implementations doing sanity checks (qemu-nbd is an example.)

Signed-off-by: Hani Benhabiles <hani@linux.com>
---
 drivers/block/nbd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
index 3a70ea2..657bdac 100644
--- a/drivers/block/nbd.c
+++ b/drivers/block/nbd.c
@@ -246,7 +246,7 @@ static int nbd_send_req(struct nbd_device *nbd, struct request *req)
 	request.magic = htonl(NBD_REQUEST_MAGIC);
 	request.type = htonl(nbd_cmd(req));
 
-	if (nbd_cmd(req) == NBD_CMD_FLUSH) {
+	if (nbd_cmd(req) == NBD_CMD_FLUSH || nbd_cmd(req) == NBD_CMD_DISC) {
 		/* Other values are reserved for FLUSH requests.  */
 		request.from = 0;
 		request.len = 0;
-- 
1.8.3.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-05-25 21:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-16 23:43 [PATCH] nbd: Zero from and len fields in NBD_CMD_DISCONNECT Hani Benhabiles
     [not found] ` <CAECXXi4_RJ-yk8Ct=sPPe-pq=shdU-4cKvRTT3yNvsoY42-8_Q@mail.gmail.com>
2014-05-18  9:11   ` Hani Benhabiles
2014-05-25 10:18     ` Hani Benhabiles
2014-05-25 18:11       ` Paul Clements
2014-05-25 21:54         ` Hani Benhabiles

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.