Skip to contentSkip to conversation

ksmbd: use SOCK_NONBLOCK type for kernel_accept()

PATCH In review Namjae Jeon 2 participants 2 messages Jun 2, 2022

Subsystems (2)
lore
Share & tools
lore

Namjae Jeon

author maintainer
#0 lore raw

PATCH 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().

---
 fs/ksmbd/transport_tcp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ksmbd/transport_tcp.c +1 -1
index 8fef9de787d3..143bba4e4db8 100644
@@ -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
Reviewed-by on v1 1/1
#1 lore raw

2022년 6월 2일 (목) 오전 10:13, Namjae Jeon <[email protected]>님이 작성:

Quoted 9 lines

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

Quoted 8 lines

/arch/alpha/include/asm/socket.h:
#define SOCK_NONBLOCK 0x40000000

Use SOCK_NONBLOCK instead of O_NONBLOCK for kernel_accept().

---

Quoted 19 lines
 fs/ksmbd/transport_tcp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ksmbd/transport_tcp.c +1 -2
index 8fef9de787d3..143bba4e4db8 100644
@@ -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