diff options
author | Yufan Chen <wiz.chen@gmail.com> | 2022-01-09 05:34:16 +0300 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2022-01-10 21:44:19 +0300 |
commit | 136dff3a6b71dc16c30b35cc390feb0bfc32ed50 (patch) | |
tree | e7bfce4dd3e83ee220ebf7bb4abc1e00498cae4b /fs/ksmbd/transport_rdma.c | |
parent | 4d02c4fdc0e256b493f9a3b604c7ff18f0019f17 (diff) | |
download | linux-136dff3a6b71dc16c30b35cc390feb0bfc32ed50.tar.xz |
ksmbd: add smb-direct shutdown
When killing ksmbd server after connecting rdma, ksmbd threads does not
terminate properly because the rdma connection is still alive.
This patch add shutdown operation to disconnect rdma connection while
ksmbd threads terminate.
Signed-off-by: Yufan Chen <wiz.chen@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/ksmbd/transport_rdma.c')
-rw-r--r-- | fs/ksmbd/transport_rdma.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/fs/ksmbd/transport_rdma.c b/fs/ksmbd/transport_rdma.c index 86fd64511512..3c1ec1ac0b27 100644 --- a/fs/ksmbd/transport_rdma.c +++ b/fs/ksmbd/transport_rdma.c @@ -1453,6 +1453,15 @@ static void smb_direct_disconnect(struct ksmbd_transport *t) free_transport(st); } +static void smb_direct_shutdown(struct ksmbd_transport *t) +{ + struct smb_direct_transport *st = smb_trans_direct_transfort(t); + + ksmbd_debug(RDMA, "smb-direct shutdown cm_id=%p\n", st->cm_id); + + smb_direct_disconnect_rdma_work(&st->disconnect_work); +} + static int smb_direct_cm_handler(struct rdma_cm_id *cm_id, struct rdma_cm_event *event) { @@ -2201,6 +2210,7 @@ out: static struct ksmbd_transport_ops ksmbd_smb_direct_transport_ops = { .prepare = smb_direct_prepare, .disconnect = smb_direct_disconnect, + .shutdown = smb_direct_shutdown, .writev = smb_direct_writev, .read = smb_direct_read, .rdma_read = smb_direct_rdma_read, |