ksmbd: use SOCK_NONBLOCK type for kernel_accept()
Subsystems (2)
Namjae Jeon
maintainerPATCH 1/1 ksmbd: use SOCK_NONBLOCK type for kernel_accept()
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 <[email protected]>
Signed-off-by Namjae Jeon <[email protected]>
--- fs/ksmbd/transport_tcp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ksmbd/transport_tcp.c +1 -1
@@ -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 )
Signature · 1 line
2.25.1
2022년 6월 2일 (목) 오전 10:13, Namjae Jeon <[email protected]>님이 작성:
Quoted 9 lines
I found that normally it is
O_NONBLOCKbut there are different value for some arch./include/linux/net.h:
#ifndefSOCK_NONBLOCK
#defineSOCK_NONBLOCKO_NONBLOCK
#endif
Quoted 8 lines
/arch/alpha/include/asm/socket.h:
#defineSOCK_NONBLOCK0x40000000Use
SOCK_NONBLOCKinstead ofO_NONBLOCKforkernel_accept().Suggested-by David Howells <[email protected]>Signed-off-by Namjae Jeon <[email protected]>---
Reviewed-by Hyunchul Lee <[email protected]>
Quoted 19 lines
fs/ksmbd/transport_tcp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/ksmbd/transport_tcp.c +1
-2@@ -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
Signature · 2 lines
Thanks, Hyunchul