Skip to content

Commit 8c48e1c

Browse files
metze-sambasmfrench
authored andcommitted
smb: client: don't wait for info->send_pending == 0 on error
We already called ib_drain_qp() before and that makes sure send_done() was called with IB_WC_WR_FLUSH_ERR, but didn't called atomic_dec_and_test(&sc->send_io.pending.count) So we may never reach the info->send_pending == 0 condition. Cc: Steve French <[email protected]> Cc: Tom Talpey <[email protected]> Cc: Long Li <[email protected]> Cc: [email protected] Cc: [email protected] Fixes: 5349ae5 ("smb: client: let send_done() cleanup before calling smbd_disconnect_rdma_connection()") Signed-off-by: Stefan Metzmacher <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent e383573 commit 8c48e1c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

fs/smb/client/smbdirect.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1337,10 +1337,6 @@ void smbd_destroy(struct TCP_Server_Info *server)
13371337
log_rdma_event(INFO, "cancelling idle timer\n");
13381338
cancel_delayed_work_sync(&info->idle_timer_work);
13391339

1340-
log_rdma_event(INFO, "wait for all send posted to IB to finish\n");
1341-
wait_event(info->wait_send_pending,
1342-
atomic_read(&info->send_pending) == 0);
1343-
13441340
/* It's not possible for upper layer to get to reassembly */
13451341
log_rdma_event(INFO, "drain the reassembly queue\n");
13461342
do {
@@ -1986,7 +1982,11 @@ int smbd_send(struct TCP_Server_Info *server,
19861982
*/
19871983

19881984
wait_event(info->wait_send_pending,
1989-
atomic_read(&info->send_pending) == 0);
1985+
atomic_read(&info->send_pending) == 0 ||
1986+
sc->status != SMBDIRECT_SOCKET_CONNECTED);
1987+
1988+
if (sc->status != SMBDIRECT_SOCKET_CONNECTED && rc == 0)
1989+
rc = -EAGAIN;
19901990

19911991
return rc;
19921992
}

0 commit comments

Comments
 (0)