[PATCH v4 004/145] smb: smbdirect: introduce smbdirect_recv_io.complex_work

Stefan Metzmacher metze at samba.org
Tue Nov 25 17:54:10 UTC 2025


This will be used by client and server in order to implement
async connect/accept logic.

The problems is that ib_post_recv() completions can run
in an interrupt context, where we are not allowed to
sleep.

During the negotiation phase we need to do complex things
e.g. allocate memory, which might sleep, so we'll offload
this to the workqueue instead.

Cc: Steve French <smfrench at gmail.com>
Cc: Tom Talpey <tom at talpey.com>
Cc: Long Li <longli at microsoft.com>
Cc: Namjae Jeon <linkinjeon at kernel.org>
Cc: linux-cifs at vger.kernel.org
Cc: samba-technical at lists.samba.org
Signed-off-by: Stefan Metzmacher <metze at samba.org>
---
 fs/smb/common/smbdirect/smbdirect_socket.h | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/fs/smb/common/smbdirect/smbdirect_socket.h b/fs/smb/common/smbdirect/smbdirect_socket.h
index cf8a16d3d895..ea269f55935d 100644
--- a/fs/smb/common/smbdirect/smbdirect_socket.h
+++ b/fs/smb/common/smbdirect/smbdirect_socket.h
@@ -631,6 +631,14 @@ struct smbdirect_recv_io {
 #define SMBDIRECT_RECV_IO_MAX_SGE 1
 	struct ib_sge sge;
 
+	/*
+	 * We may need to handle complex
+	 * work that might sleep and are
+	 * not allowed to run in an interrupt
+	 * context.
+	 */
+	struct work_struct complex_work;
+
 	/* Link to free or reassembly list */
 	struct list_head list;
 
-- 
2.43.0




More information about the samba-technical mailing list