nbd: pass MSG_* flags to kernel_recvmsg()
authorNamhyung Kim <namhyung@gmail.com>
Sat, 28 May 2011 12:44:46 +0000 (14:44 +0200)
committerJens Axboe <jaxboe@fusionio.com>
Sat, 28 May 2011 12:44:46 +0000 (14:44 +0200)
Unlike kernel_sendmsg(), kernel_recvmsg() requires passing flags explicitly
via last parameter instead of struct msghdr.msg_flags. Therefore calls to
sock_xmit(lo, 0, ..., MSG_WAITALL) have not been processed properly by tcp
layer wrt. the flag. Fix it.

Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Cc: Paul Clements <Paul.Clements@steeleye.com>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
drivers/block/nbd.c

index e6fc716aca4521cc7537e09a393b6213b0a3ea88..1df3bfe5225b0a3e2623ca35feddee74244f2e9a 100644 (file)
@@ -192,7 +192,8 @@ static int sock_xmit(struct nbd_device *lo, int send, void *buf, int size,
                        if (lo->xmit_timeout)
                                del_timer_sync(&ti);
                } else
-                       result = kernel_recvmsg(sock, &msg, &iov, 1, size, 0);
+                       result = kernel_recvmsg(sock, &msg, &iov, 1, size,
+                                               msg.msg_flags);
 
                if (signal_pending(current)) {
                        siginfo_t info;