]> git.ipfire.org Git - thirdparty/linux.git/commit
smb: smbdirect: introduce smbdirect_socket_schedule_cleanup[{_lvl,_status}]()
authorStefan Metzmacher <metze@samba.org>
Tue, 26 Aug 2025 15:25:24 +0000 (17:25 +0200)
committerSteve French <stfrench@microsoft.com>
Thu, 16 Apr 2026 02:58:18 +0000 (21:58 -0500)
commitd85614860184f31153ff243ff06e34d76c22be7b
tree0297f63481394ce25ca7d5eb6939d282a51495e7
parent1be83fad0c74b288d3664ff0677da19a997bcbf3
smb: smbdirect: introduce smbdirect_socket_schedule_cleanup[{_lvl,_status}]()

smbdirect_socket_schedule_cleanup() is more
or less copy of smbd_disconnect_rdma_connection() and
smb_direct_disconnect_rdma_connection(). It will replace
them in the next steps.

A difference is that the location of the first error is logged,
which makes it easier to analyze problems.

And also disable any complex work from recv_io objects,
currently these are not used and the work is always
disabled anyway, but this prepares future changes.

It also gets an explicit error passed
in instead of hardcoding -ECONNABORTED.

Beside the main smbdirect_socket_schedule_cleanup()
there are some special additions:
- smbdirect_socket_schedule_cleanup_lvl(),
  will be used for cases where we don't want
  a log message with SMBDIRECT_LOG_ERR.

- smbdirect_socket_schedule_cleanup_status(),
  will be used to specify the log level together
  with a direct final status, for the
  RDMA_CM_EVENT_DEVICE_REMOVAL and RDMA_CM_EVENT_DISCONNECTED
  cases where we need to avoid SMBDIRECT_SOCKET_DISCONNECTING
  and rdma_disconnect() in smbdirect_socket_cleanup_work().

With this we're also able to define a default
for __SMBDIRECT_SOCKET_DISCONNECT() just using:
smbdirect_socket_schedule_cleanup(__sc, -ECONNABORTED)

Cc: Steve French <smfrench@gmail.com>
Cc: Tom Talpey <tom@talpey.com>
Cc: Long Li <longli@microsoft.com>
Cc: Namjae Jeon <linkinjeon@kernel.org>
Cc: linux-cifs@vger.kernel.org
Cc: samba-technical@lists.samba.org
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Acked-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/common/smbdirect/smbdirect_internal.h
fs/smb/common/smbdirect/smbdirect_socket.c
fs/smb/common/smbdirect/smbdirect_socket.h