diff options
author | Long Li | 2019-04-04 11:35:42 -0500 |
---|---|---|
committer | Steve French | 2019-05-07 23:24:54 -0500 |
commit | 050b8c374019c10e4bcc3fbc9023884f76a85d9c (patch) | |
tree | d16835fec543aff2d3ca532201ede6c14df2b66a /fs/cifs/connect.c | |
parent | 973189aba69e59f11d987c21bd18409e58ece6fd (diff) |
smbd: Make upper layer decide when to destroy the transport
On transport recoonect, upper layer CIFS code destroys the current
transport and then recoonect. This code path is not used by SMBD, in that
SMBD destroys its transport on RDMA disconnect notification independent of
CIFS upper layer behavior.
This approach adds some costs to SMBD layer to handle transport shutdown
and restart, and to deal with several racing conditions on reconnecting
transport.
Re-work this code path by introducing a new smbd_destroy. This function is
called form upper layer to ask SMBD to destroy the transport. SMBD will no
longer need to destroy the transport by itself while worrying about data
transfer is in progress. The upper layer guarantees the transport is
locked.
change log:
v2: fix build errors when CONFIG_CIFS_SMB_DIRECT is not configured
Signed-off-by: Long Li <longli@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/cifs/connect.c')
-rw-r--r-- | fs/cifs/connect.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 9de8f61088ac..33e4d98fc115 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -536,7 +536,8 @@ cifs_reconnect(struct TCP_Server_Info *server) server->ssocket->state, server->ssocket->flags); sock_release(server->ssocket); server->ssocket = NULL; - } + } else if (cifs_rdma_enabled(server)) + smbd_destroy(server); server->sequence_number = 0; server->session_estab = false; kfree(server->session_key.response); @@ -929,10 +930,8 @@ static void clean_demultiplex_info(struct TCP_Server_Info *server) wake_up_all(&server->request_q); /* give those requests time to exit */ msleep(125); - if (cifs_rdma_enabled(server) && server->smbd_conn) { - smbd_destroy(server->smbd_conn); - server->smbd_conn = NULL; - } + if (cifs_rdma_enabled(server)) + smbd_destroy(server); if (server->ssocket) { sock_release(server->ssocket); server->ssocket = NULL; |