[PATCH v2 082/127] smb: client: change smbd_post_send_empty() to void return
Stefan Metzmacher
metze at samba.org
Wed Oct 29 13:21:00 UTC 2025
The caller doesn't check, so we better call
smbdirect_connection_schedule_disconnect() to handle the error.
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/client/smbdirect.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/fs/smb/client/smbdirect.c b/fs/smb/client/smbdirect.c
index ef2f957d0e86..b94fa3bec5c5 100644
--- a/fs/smb/client/smbdirect.c
+++ b/fs/smb/client/smbdirect.c
@@ -23,8 +23,6 @@ const struct smbdirect_socket_parameters *smbd_get_parameters(struct smbd_connec
return &sc->parameters;
}
-static int smbd_post_send_empty(struct smbdirect_socket *sc);
-
/* Port numbers for SMBD transport */
#define SMB_PORT 445
#define SMBD_PORT 5445
@@ -929,12 +927,17 @@ static int smbd_post_send_iter(struct smbdirect_socket *sc,
* Empty message is used to extend credits to peer to for keep live
* while there is no upper layer payload to send at the time
*/
-static int smbd_post_send_empty(struct smbdirect_socket *sc)
+static void smbd_post_send_empty(struct smbdirect_socket *sc)
{
int remaining_data_length = 0;
+ int ret;
sc->statistics.send_empty++;
- return smbd_post_send_iter(sc, NULL, &remaining_data_length);
+ ret = smbd_post_send_iter(sc, NULL, &remaining_data_length);
+ if (ret < 0) {
+ log_rdma_send(ERR, "smbd_post_send_iter failed ret=%d\n", ret);
+ smbdirect_connection_schedule_disconnect(sc, ret);
+ }
}
static int smbd_post_send_full_iter(struct smbdirect_socket *sc,
--
2.43.0
More information about the samba-technical
mailing list