]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
ksmbd: call ib_drain_qp when disconnected
authorNamjae Jeon <linkinjeon@kernel.org>
Mon, 18 Dec 2023 15:33:22 +0000 (00:33 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 23 Dec 2023 09:41:53 +0000 (10:41 +0100)
[ Upstream commit 141fa9824c0fc11d44b2d5bb1266a33e95fa67fd ]

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ksmbd/transport_rdma.c

index 652391aee73302c87b53e290a8b894ed75cd1262..68077150ad2f6ccc8f65be42a9775b186bea35e8 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);