From patchwork Wed Oct 18 23:09:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Long Li X-Patchwork-Id: 10015453 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6FF2D602C8 for ; Wed, 18 Oct 2017 23:11:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 62FC528CFE for ; Wed, 18 Oct 2017 23:11:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 564CA28D75; Wed, 18 Oct 2017 23:11:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.4 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0A5A528CFE for ; Wed, 18 Oct 2017 23:11:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751701AbdJRXLN (ORCPT ); Wed, 18 Oct 2017 19:11:13 -0400 Received: from a2nlsmtp01-03.prod.iad2.secureserver.net ([198.71.225.37]:41968 "EHLO a2nlsmtp01-03.prod.iad2.secureserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751649AbdJRXLI (ORCPT ); Wed, 18 Oct 2017 19:11:08 -0400 Received: from linuxonhyperv.com ([107.180.71.197]) by : HOSTING RELAY : with SMTP id 4xT8eRKpfS67i4xT8erQnq; Wed, 18 Oct 2017 16:10:06 -0700 x-originating-ip: 107.180.71.197 Received: from longli by linuxonhyperv.com with local (Exim 4.89) (envelope-from ) id 1e4xT8-0005VH-IX; Wed, 18 Oct 2017 16:09:46 -0700 From: Long Li To: Steve French , linux-cifs@vger.kernel.org, samba-technical@lists.samba.org, linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org, Tom Talpey , Matthew Wilcox , Stephen Hemminger Cc: Long Li Subject: [Patch v5 10/21] CIFS: SMBD: Upper layer destroys SMB Direct session on shutdown or umount Date: Wed, 18 Oct 2017 16:09:09 -0700 Message-Id: <20171018230920.21042-11-longli@exchange.microsoft.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171018230920.21042-1-longli@exchange.microsoft.com> References: <20171018230920.21042-1-longli@exchange.microsoft.com> X-CMAE-Envelope: MS4wfBCf/BXTuaHfHzgRij0jRcNQiuKJ+IVs82BW44hYlGyYovojhywSF1zAU9Q4rPgLw6Cjc628vFvPMUHDkVnAoRSvkuA/BtOxjnPflFN7fmZfEga5CjAU t0fqEWVJyWDOHTWP25vQMQ1RofC2f9wSwymjqPQFM5L0IRGHQNycjYGLzXN5xDl1k0bSnuj59FWE+oMEzsDcuqS8jRHPW1SPUN2AdFLUTa8S4kU65Dg5Fcob O8zr3aYJBEOwWNDzz7PUTFlmXSDxDtLO69+J/uEuunuPETys6lDq/mF1M31AIDJqt3X92qiFBIRXisrqX/vm7n6MjGsSAT+pMK8HtReEOKrN3sQjDFNIRTlV fYfImk5W3jvBfycePr84EFNY7v56oW//gPCKBh3v9J/X3CxvpwMOlikQAdt1PxtQeWPqaPbRWTSMRK/3DPZ5Gygy8a82ZSGkZ2Q3AQiB7p60SI/BcXD1Wm6k jwwiTY0drEPXPeU8 Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Long Li When upper layer wants to umount, make it call shutdown on transport when SMB Direct is used. Signed-off-by: Long Li --- fs/cifs/connect.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 8ca3c13..23f10d1 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -707,7 +707,12 @@ static void clean_demultiplex_info(struct TCP_Server_Info *server) wake_up_all(&server->request_q); /* give those requests time to exit */ msleep(125); - +#ifdef CONFIG_CIFS_SMB_DIRECT + if (server->smbd_conn) { + smbd_destroy(server->smbd_conn); + server->smbd_conn = NULL; + } +#endif if (server->ssocket) { sock_release(server->ssocket); server->ssocket = NULL;