From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 14E23C55178 for ; Tue, 27 Oct 2020 15:32:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BA8C420728 for ; Tue, 27 Oct 2020 15:32:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603812750; bh=MaddujSPcZsokRStR96/3MyPWWYKC/w8YF4UrqRo8fY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=a0OUqgcJNrHgdtQwJmOK8WRJ3bccR0VVnSxSUatEno8uIaSqr9DZ5H71IBMpuAeAd q7UkqlnRegw7BhsL2yLPuXgBvVewKF34y/jjogGWJRswKfuaUb3D3WiMqG1Wpj+A2Z VsI6oXXiknVA1wKB8kBGvvMAniJODYK+KNpR6e4Y= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1799622AbgJ0Pc2 (ORCPT ); Tue, 27 Oct 2020 11:32:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:35152 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1796935AbgJ0PUl (ORCPT ); Tue, 27 Oct 2020 11:20:41 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4063821527; Tue, 27 Oct 2020 15:20:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603812040; bh=MaddujSPcZsokRStR96/3MyPWWYKC/w8YF4UrqRo8fY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JjYZ4D3GffKcdpK+mBAbpObolDDc0/+7T4Po59Sv8ud8ujMrdAvr4BeGDK5BzP7jA cXXA299ofBuhcqd2BokTbJptqtynF/7sEbiAQkTpbHnFiYbMuUrrIA8I7m3DYgGgho ImlsA29KIo3M83FgG++2/in0+YXAVPpZYBBYxSIw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Steve French Subject: [PATCH 5.9 070/757] smb3: do not try to cache root directory if dir leases not supported Date: Tue, 27 Oct 2020 14:45:20 +0100 Message-Id: <20201027135453.831501205@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135450.497324313@linuxfoundation.org> References: <20201027135450.497324313@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Steve French commit 3c6e65e679182d55779ef6f8582f0945af4319b0 upstream. To servers which do not support directory leases (e.g. Samba) it is wasteful to try to open_shroot (ie attempt to cache the root directory handle). Skip attempt to open_shroot when server does not indicate support for directory leases. Cuts the number of requests on mount from 17 to 15, and cuts the number of requests on stat of the root directory from 4 to 3. Signed-off-by: Steve French CC: Stable # v5.1+ Signed-off-by: Greg Kroah-Hartman --- fs/cifs/connect.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -3595,7 +3595,10 @@ cifs_get_tcon(struct cifs_ses *ses, stru */ tcon->retry = volume_info->retry; tcon->nocase = volume_info->nocase; - tcon->nohandlecache = volume_info->nohandlecache; + if (ses->server->capabilities & SMB2_GLOBAL_CAP_DIRECTORY_LEASING) + tcon->nohandlecache = volume_info->nohandlecache; + else + tcon->nohandlecache = 1; tcon->nodelete = volume_info->nodelete; tcon->local_lease = volume_info->local_lease; INIT_LIST_HEAD(&tcon->pending_opens);