mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 03:15:31 +09:00
smb: server: split ksmbd_rdma_stop_listening() out of ksmbd_rdma_destroy()
[ Upstream commit bac7b996d42e458a94578f4227795a0d4deef6fa ]
We can't call destroy_workqueue(smb_direct_wq); before stop_sessions()!
Otherwise already existing connections try to use smb_direct_wq as
a NULL pointer.
Cc: Namjae Jeon <linkinjeon@kernel.org>
Cc: Steve French <smfrench@gmail.com>
Cc: Tom Talpey <tom@talpey.com>
Cc: linux-cifs@vger.kernel.org
Cc: samba-technical@lists.samba.org
Fixes: 0626e6641f ("cifsd: add server handler for central processing and tranport layers")
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Acked-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
740ccba37a
commit
212eb86f75
@@ -503,7 +503,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);
|
||||
}
|
||||
|
||||
@@ -2193,7 +2193,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;
|
||||
@@ -2202,7 +2202,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; }
|
||||
|
||||
Reference in New Issue
Block a user