Message ID | 20220602011313.56110-1-linkinjeon@kernel.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | ksmbd: use SOCK_NONBLOCK type for kernel_accept() | expand |
2022년 6월 2일 (목) 오전 10:13, Namjae Jeon <linkinjeon@kernel.org>님이 작성: > > 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@redhat.com> > Signed-off-by: Namjae Jeon <linkinjeon@kernel.org> > --- Reviewed-by: Hyunchul Lee <hyc.lee@gmail.com> > 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 >
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)
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@redhat.com> Signed-off-by: Namjae Jeon <linkinjeon@kernel.org> --- fs/ksmbd/transport_tcp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)