Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp323170pxx; Wed, 28 Oct 2020 05:56:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzWbk1fIcQfyK/JKb5l8FTcoxNpGE6hWPYuWY9R8IdKnb4gVxhybDxf4XKJEgaIGOGBXSZV X-Received: by 2002:aa7:cd42:: with SMTP id v2mr7244419edw.191.1603889775634; Wed, 28 Oct 2020 05:56:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603889775; cv=none; d=google.com; s=arc-20160816; b=npSrZZGkxVAoRknjOgHODR1qrocZaMAFmCz+RyIOkerTKstrF0Blfp6jHG5DLtAmqB qjv+EKiL4LkcdPa8K0UddKx9+1cRUnK+uzkZ1X/b6LmTLuDdSkxCWV0NeMouE8tN4Rvr T8mFXC4JJuoDuYyAoGZoKRYwqHmp/hsU1ZEv9QLhTQmoJ63ayw0Jq2WlONWlRugQj9yt KjlojaCdzXleWqOjFrICezvUjtJNwnOvSplTyKoamH60jIHmMYRHKL8eVSNNgoeRzjYE RwAlg1Vp1otEj08zBizvbkFZzinIssYjoD+5djZzQYFy/DFINrezvjTqGM6a6HJ0bdys i8vg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=VIe691Te7i5az6eBlS66tZMo4CebY2AypYupLnw3B1U=; b=k3+c7C2s4GPujd9E2vnAFnXyFuTT8zgJ7o9yUwIkFYCsnTDkCPROYR6uSI9j8NaOjC 2DhKoQBaeMhhlPsDBn3zMuRrJRJz6iOS8R/5n5Agoc1NYFoIdSWxf2erxUAjtp20sv2a rhdD3icH6Zl9Dj8pQrWMmF7Ui4w7dbYlFlZ73nDDrxwtTO9Sy+iwB0PqYU8Qvh2/bI+y 6uQhQu+VWBuK9liOpY83xNfeqpOtODQXo8sSoE1eZtUJq42Mk9d/nIT5YXObAflzjxpU 2ALTnNj3J0cakcdu4kvdPvblbyE9d5Ds9j1/GpCqnvgBqAcXBeSDxJGOZD4YsHoKquGu dMdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=JjYZ4D3G; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o10si2705925ejr.482.2020.10.28.05.55.53; Wed, 28 Oct 2020 05:56:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=JjYZ4D3G; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1799616AbgJ0Pc1 (ORCPT + 99 others); Tue, 27 Oct 2020 11:32:27 -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);