Skip to content

Commit a831c3e

Browse files
metze-sambagregkh
authored andcommitted
smb: client: don't wait for info->send_pending == 0 on error
commit 8c48e1c upstream. 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]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 65969af commit a831c3e

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
@@ -1316,10 +1316,6 @@ void smbd_destroy(struct TCP_Server_Info *server)
13161316
log_rdma_event(INFO, "cancelling idle timer\n");
13171317
cancel_delayed_work_sync(&info->idle_timer_work);
13181318

1319-
log_rdma_event(INFO, "wait for all send posted to IB to finish\n");
1320-
wait_event(info->wait_send_pending,
1321-
atomic_read(&info->send_pending) == 0);
1322-
13231319
/* It's not possible for upper layer to get to reassembly */
13241320
log_rdma_event(INFO, "drain the reassembly queue\n");
13251321
do {
@@ -1965,7 +1961,11 @@ int smbd_send(struct TCP_Server_Info *server,
19651961
*/
19661962

19671963
wait_event(info->wait_send_pending,
1968-
atomic_read(&info->send_pending) == 0);
1964+
atomic_read(&info->send_pending) == 0 ||
1965+
sc->status != SMBDIRECT_SOCKET_CONNECTED);
1966+
1967+
if (sc->status != SMBDIRECT_SOCKET_CONNECTED && rc == 0)
1968+
rc = -EAGAIN;
19691969

19701970
return rc;
19711971
}

0 commit comments

Comments
 (0)