mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-04 20:19:47 +08:00
Compare commits
7 Commits
068a56e56f
...
32b7144f80
Author | SHA1 | Date | |
---|---|---|---|
![]() |
32b7144f80 | ||
![]() |
eb4a0992dd | ||
![]() |
89bb430f62 | ||
![]() |
c0d41112f1 | ||
![]() |
bac7b996d4 | ||
![]() |
fd7e5de4b2 | ||
![]() |
d73915fdc0 |
@ -504,7 +504,8 @@ void ksmbd_conn_transport_destroy(void)
|
||||
{
|
||||
mutex_lock(&init_lock);
|
||||
ksmbd_tcp_destroy();
|
||||
ksmbd_rdma_destroy();
|
||||
ksmbd_rdma_stop_listening();
|
||||
stop_sessions();
|
||||
ksmbd_rdma_destroy();
|
||||
mutex_unlock(&init_lock);
|
||||
}
|
||||
|
@ -46,7 +46,12 @@ struct ksmbd_conn {
|
||||
struct mutex srv_mutex;
|
||||
int status;
|
||||
unsigned int cli_cap;
|
||||
__be32 inet_addr;
|
||||
union {
|
||||
__be32 inet_addr;
|
||||
#if IS_ENABLED(CONFIG_IPV6)
|
||||
u8 inet6_addr[16];
|
||||
#endif
|
||||
};
|
||||
char *request_buf;
|
||||
struct ksmbd_transport *transport;
|
||||
struct nls_table *local_nls;
|
||||
|
@ -1102,8 +1102,10 @@ void smb_send_parent_lease_break_noti(struct ksmbd_file *fp,
|
||||
if (!atomic_inc_not_zero(&opinfo->refcount))
|
||||
continue;
|
||||
|
||||
if (ksmbd_conn_releasing(opinfo->conn))
|
||||
if (ksmbd_conn_releasing(opinfo->conn)) {
|
||||
opinfo_put(opinfo);
|
||||
continue;
|
||||
}
|
||||
|
||||
oplock_break(opinfo, SMB2_OPLOCK_LEVEL_NONE, NULL);
|
||||
opinfo_put(opinfo);
|
||||
@ -1139,8 +1141,11 @@ void smb_lazy_parent_lease_break_close(struct ksmbd_file *fp)
|
||||
if (!atomic_inc_not_zero(&opinfo->refcount))
|
||||
continue;
|
||||
|
||||
if (ksmbd_conn_releasing(opinfo->conn))
|
||||
if (ksmbd_conn_releasing(opinfo->conn)) {
|
||||
opinfo_put(opinfo);
|
||||
continue;
|
||||
}
|
||||
|
||||
oplock_break(opinfo, SMB2_OPLOCK_LEVEL_NONE, NULL);
|
||||
opinfo_put(opinfo);
|
||||
}
|
||||
@ -1343,8 +1348,10 @@ void smb_break_all_levII_oplock(struct ksmbd_work *work, struct ksmbd_file *fp,
|
||||
if (!atomic_inc_not_zero(&brk_op->refcount))
|
||||
continue;
|
||||
|
||||
if (ksmbd_conn_releasing(brk_op->conn))
|
||||
if (ksmbd_conn_releasing(brk_op->conn)) {
|
||||
opinfo_put(brk_op);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (brk_op->is_lease && (brk_op->o_lease->state &
|
||||
(~(SMB2_LEASE_READ_CACHING_LE |
|
||||
|
@ -2194,7 +2194,7 @@ int ksmbd_rdma_init(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void ksmbd_rdma_destroy(void)
|
||||
void ksmbd_rdma_stop_listening(void)
|
||||
{
|
||||
if (!smb_direct_listener.cm_id)
|
||||
return;
|
||||
@ -2203,7 +2203,10 @@ void ksmbd_rdma_destroy(void)
|
||||
rdma_destroy_id(smb_direct_listener.cm_id);
|
||||
|
||||
smb_direct_listener.cm_id = NULL;
|
||||
}
|
||||
|
||||
void ksmbd_rdma_destroy(void)
|
||||
{
|
||||
if (smb_direct_wq) {
|
||||
destroy_workqueue(smb_direct_wq);
|
||||
smb_direct_wq = NULL;
|
||||
|
@ -54,13 +54,15 @@ struct smb_direct_data_transfer {
|
||||
|
||||
#ifdef CONFIG_SMB_SERVER_SMBDIRECT
|
||||
int ksmbd_rdma_init(void);
|
||||
void ksmbd_rdma_stop_listening(void);
|
||||
void ksmbd_rdma_destroy(void);
|
||||
bool ksmbd_rdma_capable_netdev(struct net_device *netdev);
|
||||
void init_smbd_max_io_size(unsigned int sz);
|
||||
unsigned int get_smbd_max_read_write_size(void);
|
||||
#else
|
||||
static inline int ksmbd_rdma_init(void) { return 0; }
|
||||
static inline int ksmbd_rdma_destroy(void) { return 0; }
|
||||
static inline void ksmbd_rdma_stop_listening(void) { }
|
||||
static inline void ksmbd_rdma_destroy(void) { }
|
||||
static inline bool ksmbd_rdma_capable_netdev(struct net_device *netdev) { return false; }
|
||||
static inline void init_smbd_max_io_size(unsigned int sz) { }
|
||||
static inline unsigned int get_smbd_max_read_write_size(void) { return 0; }
|
||||
|
@ -85,7 +85,14 @@ static struct tcp_transport *alloc_transport(struct socket *client_sk)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#if IS_ENABLED(CONFIG_IPV6)
|
||||
if (client_sk->sk->sk_family == AF_INET6)
|
||||
memcpy(&conn->inet6_addr, &client_sk->sk->sk_v6_daddr, 16);
|
||||
else
|
||||
conn->inet_addr = inet_sk(client_sk->sk)->inet_daddr;
|
||||
#else
|
||||
conn->inet_addr = inet_sk(client_sk->sk)->inet_daddr;
|
||||
#endif
|
||||
conn->transport = KSMBD_TRANS(t);
|
||||
KSMBD_TRANS(t)->conn = conn;
|
||||
KSMBD_TRANS(t)->ops = &ksmbd_tcp_transport_ops;
|
||||
@ -229,7 +236,6 @@ static int ksmbd_kthread_fn(void *p)
|
||||
{
|
||||
struct socket *client_sk = NULL;
|
||||
struct interface *iface = (struct interface *)p;
|
||||
struct inet_sock *csk_inet;
|
||||
struct ksmbd_conn *conn;
|
||||
int ret;
|
||||
|
||||
@ -252,13 +258,27 @@ static int ksmbd_kthread_fn(void *p)
|
||||
/*
|
||||
* Limits repeated connections from clients with the same IP.
|
||||
*/
|
||||
csk_inet = inet_sk(client_sk->sk);
|
||||
down_read(&conn_list_lock);
|
||||
list_for_each_entry(conn, &conn_list, conns_list)
|
||||
if (csk_inet->inet_daddr == conn->inet_addr) {
|
||||
#if IS_ENABLED(CONFIG_IPV6)
|
||||
if (client_sk->sk->sk_family == AF_INET6) {
|
||||
if (memcmp(&client_sk->sk->sk_v6_daddr,
|
||||
&conn->inet6_addr, 16) == 0) {
|
||||
ret = -EAGAIN;
|
||||
break;
|
||||
}
|
||||
} else if (inet_sk(client_sk->sk)->inet_daddr ==
|
||||
conn->inet_addr) {
|
||||
ret = -EAGAIN;
|
||||
break;
|
||||
}
|
||||
#else
|
||||
if (inet_sk(client_sk->sk)->inet_daddr ==
|
||||
conn->inet_addr) {
|
||||
ret = -EAGAIN;
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
up_read(&conn_list_lock);
|
||||
if (ret == -EAGAIN)
|
||||
continue;
|
||||
|
@ -140,8 +140,8 @@ config CRYPTO_LIB_CHACHA20POLY1305
|
||||
config CRYPTO_LIB_SHA1
|
||||
tristate
|
||||
help
|
||||
The SHA-1 library functions. Select this if your module uses any of
|
||||
the functions from <crypto/sha1.h>.
|
||||
The SHA-1 and HMAC-SHA1 library functions. Select this if your module
|
||||
uses any of the functions from <crypto/sha1.h>.
|
||||
|
||||
config CRYPTO_LIB_SHA1_ARCH
|
||||
bool
|
||||
@ -157,9 +157,9 @@ config CRYPTO_LIB_SHA1_ARCH
|
||||
config CRYPTO_LIB_SHA256
|
||||
tristate
|
||||
help
|
||||
Enable the SHA-256 library interface. This interface may be fulfilled
|
||||
by either the generic implementation or an arch-specific one, if one
|
||||
is available and enabled.
|
||||
The SHA-224, SHA-256, HMAC-SHA224, and HMAC-SHA256 library functions.
|
||||
Select this if your module uses any of these functions from
|
||||
<crypto/sha2.h>.
|
||||
|
||||
config CRYPTO_LIB_SHA256_ARCH
|
||||
bool
|
||||
|
@ -100,7 +100,6 @@ ifeq ($(CONFIG_ARM),y)
|
||||
libsha256-y += arm/sha256-ce.o arm/sha256-core.o
|
||||
$(obj)/arm/sha256-core.S: $(src)/arm/sha256-armv4.pl
|
||||
$(call cmd,perlasm)
|
||||
clean-files += arm/sha256-core.S
|
||||
AFLAGS_arm/sha256-core.o += $(aflags-thumb2-y)
|
||||
endif
|
||||
|
||||
@ -108,7 +107,6 @@ ifeq ($(CONFIG_ARM64),y)
|
||||
libsha256-y += arm64/sha256-core.o
|
||||
$(obj)/arm64/sha256-core.S: $(src)/arm64/sha2-armv8.pl
|
||||
$(call cmd,perlasm_with_args)
|
||||
clean-files += arm64/sha256-core.S
|
||||
libsha256-$(CONFIG_KERNEL_MODE_NEON) += arm64/sha256-ce.o
|
||||
endif
|
||||
|
||||
@ -132,7 +130,6 @@ ifeq ($(CONFIG_ARM),y)
|
||||
libsha512-y += arm/sha512-core.o
|
||||
$(obj)/arm/sha512-core.S: $(src)/arm/sha512-armv4.pl
|
||||
$(call cmd,perlasm)
|
||||
clean-files += arm/sha512-core.S
|
||||
AFLAGS_arm/sha512-core.o += $(aflags-thumb2-y)
|
||||
endif
|
||||
|
||||
@ -140,7 +137,6 @@ ifeq ($(CONFIG_ARM64),y)
|
||||
libsha512-y += arm64/sha512-core.o
|
||||
$(obj)/arm64/sha512-core.S: $(src)/arm64/sha2-armv8.pl
|
||||
$(call cmd,perlasm_with_args)
|
||||
clean-files += arm64/sha512-core.S
|
||||
libsha512-$(CONFIG_KERNEL_MODE_NEON) += arm64/sha512-ce-core.o
|
||||
endif
|
||||
|
||||
@ -167,3 +163,7 @@ obj-$(CONFIG_PPC) += powerpc/
|
||||
obj-$(CONFIG_RISCV) += riscv/
|
||||
obj-$(CONFIG_S390) += s390/
|
||||
obj-$(CONFIG_X86) += x86/
|
||||
|
||||
# clean-files must be defined unconditionally
|
||||
clean-files += arm/sha256-core.S arm/sha512-core.S
|
||||
clean-files += arm64/sha256-core.S arm64/sha512-core.S
|
||||
|
Loading…
Reference in New Issue
Block a user