Commit f574069
smb: server: let smb_direct_cm_handler() call ib_drain_qp() after smb_direct_disconnect_rdma_work()
All handlers triggered by ib_drain_qp() should already see the
broken connection.
smb_direct_cm_handler() is called under a mutex of the rdma_cm,
we should make sure ib_drain_qp() and all rdma layer logic completes
and unlocks the mutex.
It means free_transport() will also already see the connection
as SMBDIRECT_SOCKET_DISCONNECTED, so we need to call
crdma_[un]lock_handler(sc->rdma.cm_id) around
ib_drain_qp(), rdma_destroy_qp(), ib_free_cq() and ib_dealloc_pd().
Otherwise we free resources while the ib_drain_qp() within
smb_direct_cm_handler() is still running.
We have to unlock before rdma_destroy_id() as it locks again.
Fixes: 141fa98 ("ksmbd: call ib_drain_qp when disconnected")
Fixes: 4c564f0 ("smb: server: make use of common smbdirect_socket")
Cc: Namjae Jeon <[email protected]>
Cc: Steve French <[email protected]>
Cc: Tom Talpey <[email protected]>
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Stefan Metzmacher <[email protected]>
Acked-by: Namjae Jeon <[email protected]>
Signed-off-by: Steve French <[email protected]>1 parent 975f05a commit f574069
1 file changed
Lines changed: 8 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
466 | 466 | | |
467 | 467 | | |
468 | 468 | | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
469 | 472 | | |
470 | 473 | | |
471 | 474 | | |
| |||
494 | 497 | | |
495 | 498 | | |
496 | 499 | | |
497 | | - | |
| 500 | + | |
| 501 | + | |
498 | 502 | | |
| 503 | + | |
499 | 504 | | |
500 | 505 | | |
501 | 506 | | |
| |||
1724 | 1729 | | |
1725 | 1730 | | |
1726 | 1731 | | |
1727 | | - | |
1728 | | - | |
1729 | 1732 | | |
1730 | 1733 | | |
| 1734 | + | |
| 1735 | + | |
1731 | 1736 | | |
1732 | 1737 | | |
1733 | 1738 | | |
| |||
0 commit comments