Skip to contentSkip to conversation

smb: server: split ksmbd_rdma_stop_listening() out of ksmbd_rdma_destroy()

PATCH Applied Stefan Metzmacher 4 participants 9 messages Aug 12, 2025 – Aug 15, 2025

Subsystems (3)
lore
Share & tools
lore

Stefan Metzmacher

author reviewer
#0 lore raw

PATCH 1/1 smb: server: split ksmbd_rdma_stop_listening() out of ksmbd_rdma_destroy()

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 <[email protected]>
Cc Steve French <[email protected]>
Cc Tom Talpey <[email protected]>
Fixes 0626e6641f6b ("cifsd: add server handler for central processing and tranport layers")
---
 fs/smb/server/connection.c     | 3 ++-
 fs/smb/server/transport_rdma.c | 5 ++++-
 fs/smb/server/transport_rdma.h | 4 +++-
 3 files changed, 9 insertions(+), 3 deletions(-)
fs/smb/server/connection.c +2 -1
index d1f36f899699..525409706805 100644
@@ -517,7 +517,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);
 }
fs/smb/server/transport_rdma.c +4 -1
index 99964a75d13e..16bf68dbf4ae 100644
@@ -2200,7 +2200,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;
@@ -2209,7 +2209,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;
fs/smb/server/transport_rdma.h +3 -1
index 0fb692c40e21..659ed668de2d 100644
@@ -13,13 +13,15 @@
 
 #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) { return };
+static inline void ksmbd_rdma_destroy(void) { return; }
 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; }
Signature · 1 line
2.43.0
maintainer Applied
#1 lore raw
Quoted 6 lines · Stefan Metzmacher via samba-technical

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.

Quoted 7 lines
Cc Namjae Jeon <[email protected]>
Cc Steve French <[email protected]>
Cc Tom Talpey <[email protected]>
Fixes 0626e6641f6b ("cifsd: add server handler for central processing and tranport layers")

Applied it to #ksmbd-for-next-next.
Thanks!

#2 lore raw
In reply to Stefan Metzmacher
Quoted 63 lines · Stefan Metzmacher

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 <[email protected]>
Cc Steve French <[email protected]>
Cc Tom Talpey <[email protected]>
Fixes 0626e6641f6b ("cifsd: add server handler for central processing and tranport layers")
---
 fs/smb/server/connection.c     | 3 ++-
 fs/smb/server/transport_rdma.c | 5 ++++-
 fs/smb/server/transport_rdma.h | 4 +++-
 3 files changed, 9 insertions(+), 3 deletions(-)
fs/smb/server/connection.c +2 -1
index d1f36f899699..525409706805 100644
@@ -517,7 +517,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);
 }
fs/smb/server/transport_rdma.c +4 -1
index 99964a75d13e..16bf68dbf4ae 100644
@@ -2200,7 +2200,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;
@@ -2209,7 +2209,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;
fs/smb/server/transport_rdma.h +0 -0
index 0fb692c40e21..659ed668de2d 100644
@@ -13,13 +13,15 @@
 
 #ifdef CONFIG_SMB_SERVER_SMBDIRECT

fs/smb/server/transport_rdma.h line 23

Quoted 10 lines
fs/smb/server/transport_rdma.h +2 -1
 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) { return };

^^ return; (nothing at all would be even better)
This seems to have broken our internal linux-next builds.

Thanks,
Pedro

author reviewer
#3 lore raw

Hi Pedro,

Quoted 11 lines
Quoted 11 lines
fs/smb/server/transport_rdma.c +2 -0
+void ksmbd_rdma_destroy(void)
+{
  	if (smb_direct_wq) {
  		destroy_workqueue(smb_direct_wq);
  		smb_direct_wq = NULL;
fs/smb/server/transport_rdma.h +0 -0
index 0fb692c40e21..659ed668de2d 100644
@@ -13,13 +13,15 @@
 
Quoted 13 lines

fs/smb/server/transport_rdma.h line 23

Quoted 11 lines
fs/smb/server/transport_rdma.h +2 -1
  #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) { return };

^^ return; (nothing at all would be even better)
This seems to have broken our internal linux-next builds.

Sorry for that!

Steve can you remove 'return' so that the line is this:
static inline void ksmbd_rdma_stop_listening(void) { }

Thanks!
metze

Acked-by Namjae Jeon
#4 lore raw
Quoted 2 lines

Steve can you remove 'return' so that the line is this:
static inline void ksmbd_rdma_stop_listening(void) {

Done, and have updated ksmbd-for-next

Updated patch also attached, let me know if any problems.

Also let me know if you have rebased versions of the other smbdirect patches for 6.18-rc so I can get them in linux-next

Quoted 35 lines · Stefan Metzmacher

Hi Pedro,

Quoted 11 lines
Quoted 11 lines
(quoted diff) +2 -0
+void ksmbd_rdma_destroy(void)
+{
     if (smb_direct_wq) {
             destroy_workqueue(smb_direct_wq);
             smb_direct_wq = NULL;
fs/smb/server/transport_rdma.h +0 -0
index 0fb692c40e21..659ed668de2d 100644
@@ -13,13 +13,15 @@
 
Quoted 13 lines

fs/smb/server/transport_rdma.h line 23

Quoted 11 lines
fs/smb/server/transport_rdma.h +2 -1
  #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) { return };

^^ return; (nothing at all would be even better)
This seems to have broken our internal linux-next builds.

Sorry for that!

Steve can you remove 'return' so that the line is this:
static inline void ksmbd_rdma_stop_listening(void) { }

Thanks!
metze

Signature · 3 lines
Thanks,

Steve

From a49501023f50d39e06c420ac09b74185d06ee0e6 Mon Sep 17 00:00:00 2001
From: Stefan Metzmacher <[email protected]>
Date: Tue, 12 Aug 2025 18:45:46 +0200
Subject: [PATCH] smb: server: split ksmbd_rdma_stop_listening() out of
ksmbd_rdma_destroy()

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 <[email protected]>
Cc Steve French <[email protected]>
Cc Tom Talpey <[email protected]>
Fixes 0626e6641f6b ("cifsd: add server handler for central processing and tranport layers")
---
 fs/smb/server/connection.c     | 3 ++-
 fs/smb/server/transport_rdma.c | 5 ++++-
 fs/smb/server/transport_rdma.h | 4 +++-
 3 files changed, 9 insertions(+), 3 deletions(-)
fs/smb/server/connection.c +2 -1
index 3f04a2977ba8..67c4f73398df 100644
@@ -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);
 }
fs/smb/server/transport_rdma.c +4 -1
index 8d366db5f605..5466aa8c39b1 100644
@@ -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;
fs/smb/server/transport_rdma.h +3 -1
index 77aee4e5c9dc..c2f46cd48e44 100644
@@ -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) { return; }
 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; }
Signature · 1 line
2.43.0
author reviewer
#5 lore raw

Am 15.08.25 um 18:52 schrieb Steve French:

Quoted 6 lines
Quoted 2 lines

Steve can you remove 'return' so that the line is this:
static inline void ksmbd_rdma_stop_listening(void) {

Done, and have updated ksmbd-for-next

Updated patch also attached, let me know if any problems.

Maybe also remove the 'return;' from the inline ksmbd_rdma_destroy function?

Quoted 2 lines

Also let me know if you have rebased versions of the other smbdirect patches for 6.18-rc so I can get them in linux-next

I guess I'll base on Monday on 6.17-rc2 and will post what I have then.

Thanks!
metze

Acked-by Namjae Jeon
#6 lore raw
Quoted 1 line

Maybe also remove the 'return;' from the inline ksmbd_rdma_destroy function?

Done (updated cifs-2.6.git for-next with attached)

It does look a little strange that a trailing ';' is only after the ksmbd_rdma_stop_listening() line - is that intentional

fs/smb/server/transport_rdma.h +3 -1
index 77aee4e5c9dc..ce3c88a45875 100644
@@ -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; }

Quoted 19 lines · Stefan Metzmacher

Am 15.08.25 um 18:52 schrieb Steve French:

Quoted 6 lines
Quoted 2 lines

Steve can you remove 'return' so that the line is this:
static inline void ksmbd_rdma_stop_listening(void) {

Done, and have updated ksmbd-for-next

Updated patch also attached, let me know if any problems.

Maybe also remove the 'return;' from the inline ksmbd_rdma_destroy function?

Quoted 2 lines

Also let me know if you have rebased versions of the other smbdirect patches for 6.18-rc so I can get them in linux-next

I guess I'll base on Monday on 6.17-rc2 and will post what I have then.

Thanks!
metze

Signature · 3 lines
Thanks,

Steve

From 656205db650a9942a33b5cc5bc9012c331746596 Mon Sep 17 00:00:00 2001
From: Stefan Metzmacher <[email protected]>
Date: Tue, 12 Aug 2025 18:45:46 +0200
Subject: [PATCH] smb: server: split ksmbd_rdma_stop_listening() out of
ksmbd_rdma_destroy()

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 <[email protected]>
Cc Steve French <[email protected]>
Cc Tom Talpey <[email protected]>
Fixes 0626e6641f6b ("cifsd: add server handler for central processing and tranport layers")
---
 fs/smb/server/connection.c     | 3 ++-
 fs/smb/server/transport_rdma.c | 5 ++++-
 fs/smb/server/transport_rdma.h | 4 +++-
 3 files changed, 9 insertions(+), 3 deletions(-)
fs/smb/server/connection.c +2 -1
index 3f04a2977ba8..67c4f73398df 100644
@@ -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);
 }
fs/smb/server/transport_rdma.c +4 -1
index 8d366db5f605..5466aa8c39b1 100644
@@ -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;
fs/smb/server/transport_rdma.h +3 -1
index 77aee4e5c9dc..ce3c88a45875 100644
@@ -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; }
Signature · 1 line
2.43.0
author reviewer
#7 lore raw

Am 15.08.25 um 20:52 schrieb Steve French:

Quoted 15 lines
Quoted 1 line

Maybe also remove the 'return;' from the inline ksmbd_rdma_destroy function?

Done (updated cifs-2.6.git for-next with attached)

It does look a little strange that a trailing ';' is only after the ksmbd_rdma_stop_listening() line - is that intentional

fs/smb/server/transport_rdma.h +0 -0
index 77aee4e5c9dc..ce3c88a45875 100644
@@ -54,13 +54,15 @@ struct smb_direct_data_transfer {
 
  #ifdef CONFIG_SMB_SERVER_SMBDIRECT
  int ksmbd_rdma_init(void);

fs/smb/server/transport_rdma.h struct smb_direct_data_transfer { · line 65

Quoted 10 lines
fs/smb/server/transport_rdma.h +3 -1
+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) { }

No it needs to be just { } in both cases.

Thanks!
metze

Acked-by Namjae Jeon
#8 lore raw

updated ksmbd-for-next (also can see attached patch)

Quoted 34 lines · Stefan Metzmacher

Am 15.08.25 um 20:52 schrieb Steve French:

Quoted 15 lines
Quoted 1 line

Maybe also remove the 'return;' from the inline ksmbd_rdma_destroy function?

Done (updated cifs-2.6.git for-next with attached)

It does look a little strange that a trailing ';' is only after the ksmbd_rdma_stop_listening() line - is that intentional

fs/smb/server/transport_rdma.h +0 -0
index 77aee4e5c9dc..ce3c88a45875 100644
@@ -54,13 +54,15 @@ struct smb_direct_data_transfer {
 
  #ifdef CONFIG_SMB_SERVER_SMBDIRECT
  int ksmbd_rdma_init(void);

fs/smb/server/transport_rdma.h struct smb_direct_data_transfer { · line 65

Quoted 10 lines
fs/smb/server/transport_rdma.h +3 -1
+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) { }

No it needs to be just { } in both cases.

Thanks!
metze

Signature · 3 lines
Thanks,

Steve

From 473b1f20f5919ca58deea2d23d39f75b11aef831 Mon Sep 17 00:00:00 2001
From: Stefan Metzmacher <[email protected]>
Date: Tue, 12 Aug 2025 18:45:46 +0200
Subject: [PATCH] smb: server: split ksmbd_rdma_stop_listening() out of
ksmbd_rdma_destroy()

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 <[email protected]>
Cc Steve French <[email protected]>
Cc Tom Talpey <[email protected]>
Fixes 0626e6641f6b ("cifsd: add server handler for central processing and tranport layers")
---
 fs/smb/server/connection.c     | 3 ++-
 fs/smb/server/transport_rdma.c | 5 ++++-
 fs/smb/server/transport_rdma.h | 4 +++-
 3 files changed, 9 insertions(+), 3 deletions(-)
fs/smb/server/connection.c +2 -1
index 3f04a2977ba8..67c4f73398df 100644
@@ -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);
 }
fs/smb/server/transport_rdma.c +4 -1
index 8d366db5f605..5466aa8c39b1 100644
@@ -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;
fs/smb/server/transport_rdma.h +3 -1
index 77aee4e5c9dc..a2291b77488a 100644
@@ -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; }
Signature · 1 line
2.43.0