Re: [PATCH] ksmbd: use SOCK_NONBLOCK type for kernel_accept()

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

 



2022년 6월 2일 (목) 오전 10:13, Namjae Jeon <linkinjeon@xxxxxxxxxx>님이 작성:
>
> I found that normally it is O_NONBLOCK but there are different value
> for some arch.
>
> /include/linux/net.h:
> #ifndef SOCK_NONBLOCK
> #define SOCK_NONBLOCK   O_NONBLOCK
> #endif
>
> /arch/alpha/include/asm/socket.h:
> #define SOCK_NONBLOCK   0x40000000
>
> Use SOCK_NONBLOCK instead of O_NONBLOCK for kernel_accept().
>
> Suggested-by: David Howells <dhowells@xxxxxxxxxx>
> Signed-off-by: Namjae Jeon <linkinjeon@xxxxxxxxxx>
> ---

Reviewed-by: Hyunchul Lee <hyc.lee@xxxxxxxxx>

>  fs/ksmbd/transport_tcp.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/ksmbd/transport_tcp.c b/fs/ksmbd/transport_tcp.c
> index 8fef9de787d3..143bba4e4db8 100644
> --- a/fs/ksmbd/transport_tcp.c
> +++ b/fs/ksmbd/transport_tcp.c
> @@ -230,7 +230,7 @@ static int ksmbd_kthread_fn(void *p)
>                         break;
>                 }
>                 ret = kernel_accept(iface->ksmbd_socket, &client_sk,
> -                                   O_NONBLOCK);
> +                                   SOCK_NONBLOCK);
>                 mutex_unlock(&iface->sock_release_lock);
>                 if (ret) {
>                         if (ret == -EAGAIN)
> --
> 2.25.1
>


-- 
Thanks,
Hyunchul




[Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux