Skip to content

Commit

Permalink
nbd: pass MSG_* flags to kernel_recvmsg()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Cc: Paul Clements <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
namhyung authored and Jens Axboe committed May 28, 2011
1 parent 6df87e6 commit 35fbf5b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/block/nbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 35fbf5b

Please sign in to comment.