diff options
author | Yufan Chen <wiz.chen@gmail.com> | 2022-01-09 11:34:16 +0900 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2022-01-10 12:44:19 -0600 |
commit | 136dff3a6b71dc16c30b35cc390feb0bfc32ed50 (patch) | |
tree | e7bfce4dd3e83ee220ebf7bb4abc1e00498cae4b /fs/ksmbd/connection.c | |
parent | 4d02c4fdc0e256b493f9a3b604c7ff18f0019f17 (diff) | |
download | linux-stable-136dff3a6b71dc16c30b35cc390feb0bfc32ed50.tar.gz linux-stable-136dff3a6b71dc16c30b35cc390feb0bfc32ed50.tar.bz2 linux-stable-136dff3a6b71dc16c30b35cc390feb0bfc32ed50.zip |
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/connection.c')
-rw-r--r-- | fs/ksmbd/connection.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/fs/ksmbd/connection.c b/fs/ksmbd/connection.c index d1d0105be5b1..208d2cff7bd3 100644 --- a/fs/ksmbd/connection.c +++ b/fs/ksmbd/connection.c @@ -387,17 +387,24 @@ out: static void stop_sessions(void) { struct ksmbd_conn *conn; + struct ksmbd_transport *t; again: read_lock(&conn_list_lock); list_for_each_entry(conn, &conn_list, conns_list) { struct task_struct *task; - task = conn->transport->handler; + t = conn->transport; + task = t->handler; if (task) ksmbd_debug(CONN, "Stop session handler %s/%d\n", task->comm, task_pid_nr(task)); conn->status = KSMBD_SESS_EXITING; + if (t->ops->shutdown) { + read_unlock(&conn_list_lock); + t->ops->shutdown(t); + read_lock(&conn_list_lock); + } } read_unlock(&conn_list_lock); |