smb: client/smbdirect: introduce SMBDIRECT_SOCKET_ERROR

This will be used to turn SMBDIRECT_SOCKET_CONNECTED into an
error within smbd_disconnect_rdma_connection() on the client
and smb_direct_disconnect_rdma_connection() on the server.

We do this in a single commit with the client as otherwise it
won't build because the enum value is not handled in the
switch statement.

Cc: Steve French <smfrench@gmail.com>
Cc: Tom Talpey <tom@talpey.com>
Cc: Long Li <longli@microsoft.com>
Acked-by: 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>
Signed-off-by: Steve French <stfrench@microsoft.com>
This commit is contained in:
Stefan Metzmacher 2025-08-28 10:39:56 +02:00 committed by Steve French
parent 58dfba8a2d
commit cc678b8a89
2 changed files with 4 additions and 0 deletions

View File

@ -166,6 +166,7 @@ static void smbd_disconnect_rdma_work(struct work_struct *work)
case SMBDIRECT_SOCKET_NEGOTIATE_RUNNING:
case SMBDIRECT_SOCKET_NEGOTIATE_FAILED:
case SMBDIRECT_SOCKET_CONNECTED:
case SMBDIRECT_SOCKET_ERROR:
sc->status = SMBDIRECT_SOCKET_DISCONNECTING;
rdma_disconnect(sc->rdma.cm_id);
break;

View File

@ -23,6 +23,7 @@ enum smbdirect_socket_status {
SMBDIRECT_SOCKET_NEGOTIATE_RUNNING,
SMBDIRECT_SOCKET_NEGOTIATE_FAILED,
SMBDIRECT_SOCKET_CONNECTED,
SMBDIRECT_SOCKET_ERROR,
SMBDIRECT_SOCKET_DISCONNECTING,
SMBDIRECT_SOCKET_DISCONNECTED,
SMBDIRECT_SOCKET_DESTROYED
@ -60,6 +61,8 @@ const char *smbdirect_socket_status_string(enum smbdirect_socket_status status)
return "NEGOTIATE_FAILED";
case SMBDIRECT_SOCKET_CONNECTED:
return "CONNECTED";
case SMBDIRECT_SOCKET_ERROR:
return "ERROR";
case SMBDIRECT_SOCKET_DISCONNECTING:
return "DISCONNECTING";
case SMBDIRECT_SOCKET_DISCONNECTED: