[PATCH v4 087/145] smb: client: change smbd_post_send_empty() to void return
Stefan Metzmacher
metze at samba.org
Tue Nov 25 17:55:33 UTC 2025
The caller doesn't check, so we better call
smbdirect_socket_schedule_cleanup() 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>
Signed-off-by: Steve French <stfrench at microsoft.com>
---
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 42f85dd42e7b..bc8c3e3f705f 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
@@ -930,12 +928,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_socket_schedule_cleanup(sc, ret);
+ }
}
static int smbd_post_send_full_iter(struct smbdirect_socket *sc,
--
2.43.0
More information about the samba-technical
mailing list