]> git.baikalelectronics.ru Git - kernel.git/commitdiff
ksmbd: call ib_drain_qp when disconnected
authorNamjae Jeon <linkinjeon@kernel.org>
Sun, 2 Oct 2022 00:38:48 +0000 (09:38 +0900)
committerSteve French <stfrench@microsoft.com>
Wed, 5 Oct 2022 06:15:44 +0000 (01:15 -0500)
When disconnected, call ib_drain_qp to cancel all pending work requests
and prevent ksmbd_conn_handler_loop from waiting for a long time
for those work requests to compelete.

Signed-off-by: Hyunchul Lee <hyc.lee@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Reviewed-by: Tom Talpey <tom@talpey.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/ksmbd/transport_rdma.c

index 0315bca3d53bf2c36fafbe3b51378582a844bd82..096eda9ef873b670b46e735178bccb15742c4268 100644 (file)
@@ -1527,6 +1527,8 @@ static int smb_direct_cm_handler(struct rdma_cm_id *cm_id,
        }
        case RDMA_CM_EVENT_DEVICE_REMOVAL:
        case RDMA_CM_EVENT_DISCONNECTED: {
+               ib_drain_qp(t->qp);
+
                t->status = SMB_DIRECT_CS_DISCONNECTED;
                wake_up_interruptible(&t->wait_status);
                wake_up_interruptible(&t->wait_reassembly_queue);