Commit 323b1ea1 authored by Hyunchul Lee's avatar Hyunchul Lee Committed by Namjae Jeon

ksmbd: smbd: fix kernel oops during server shutdown

if server shutdown happens in the situation that
there are connections, workqueue could be destroyed
before queueing disconnect work.
Signed-off-by: default avatarHyunchul Lee <hyc.lee@gmail.com>
Signed-off-by: default avatarNamjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
parent 777cad16
...@@ -329,7 +329,8 @@ static void smb_direct_disconnect_rdma_work(struct work_struct *work) ...@@ -329,7 +329,8 @@ static void smb_direct_disconnect_rdma_work(struct work_struct *work)
static void static void
smb_direct_disconnect_rdma_connection(struct smb_direct_transport *t) smb_direct_disconnect_rdma_connection(struct smb_direct_transport *t)
{ {
queue_work(smb_direct_wq, &t->disconnect_work); if (t->status == SMB_DIRECT_CS_CONNECTED)
queue_work(smb_direct_wq, &t->disconnect_work);
} }
static void smb_direct_send_immediate_work(struct work_struct *work) static void smb_direct_send_immediate_work(struct work_struct *work)
...@@ -1415,7 +1416,7 @@ static void smb_direct_disconnect(struct ksmbd_transport *t) ...@@ -1415,7 +1416,7 @@ static void smb_direct_disconnect(struct ksmbd_transport *t)
ksmbd_debug(RDMA, "Disconnecting cm_id=%p\n", st->cm_id); ksmbd_debug(RDMA, "Disconnecting cm_id=%p\n", st->cm_id);
smb_direct_disconnect_rdma_connection(st); smb_direct_disconnect_rdma_work(&st->disconnect_work);
wait_event_interruptible(st->wait_status, wait_event_interruptible(st->wait_status,
st->status == SMB_DIRECT_CS_DISCONNECTED); st->status == SMB_DIRECT_CS_DISCONNECTED);
free_transport(st); free_transport(st);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment