lkml.org 
[lkml]   [2011]   [May]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 1/3] nbd: pass MSG_* flags to kernel_recvmsg()
From
On Fri, May 27, 2011 at 2:00 AM, Namhyung Kim <namhyung@gmail.com> wrote:
> 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.

Thanks. Good catch. I wonder why recvmsg takes external flags and
sendmsg uses the ones attached to msg? Odd...

--
Paul

> Signed-off-by: Namhyung Kim <namhyung@gmail.com>
> Cc: Paul Clements <Paul.Clements@steeleye.com>
> ---
>  drivers/block/nbd.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
> index e6fc716aca45..1df3bfe5225b 100644
> --- a/drivers/block/nbd.c
> +++ b/drivers/block/nbd.c
> @@ -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;
> --
> 1.7.5.2
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2011-05-27 14:35    [W:0.190 / U:0.188 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site