Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp162202pxb; Wed, 24 Feb 2021 22:06:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJxTSgYYqsRLRacnwdZ5KLOLvliBaCX5KIU7RtpszanpgKSNcktfyPWyJOfKCee6B/S5qdQD X-Received: by 2002:a17:907:98f5:: with SMTP id ke21mr1160175ejc.552.1614233192451; Wed, 24 Feb 2021 22:06:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614233192; cv=none; d=google.com; s=arc-20160816; b=E+TZpSrQfICvXb4kYQmgx2R8C3Ogk3uGiH3h0kHDeiPprMveiYL+//47WrxGFqufWg lIn78lS7629IrYCDsvLO9Di9yPrmXvq+/9x2BkEKip8H3wShpL3ec6xZcCyt2c5Igw7Z fOzgaHxnmKIrjPv1tP2CMNsrD9Www2C85gUnb+teLYiLo0O8y3jzedGe0D4jO4YrK81C zg9pmCjBaaY5ArmUQUK5RfPPPQ3PPA5J7HR+isCxCP3I5ANKP9QmeTjaLqGDMXWcPE73 u7Un2jqT4EvT/T7DtyEIInepMim+LEAjYsgiealmwq5tSxpedDRvwUwU7oVRSL1cI2QR xNbA== 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:cc:subject:date:to :from; bh=DKJ74UkVFLOif4UsPSgWElfqR54LNAtivHSAg466WoQ=; b=Ejhf1s66hijhFcX+79/hWR1AZqMbUAJSGW5+OMTuiOi9j9p3w58NWFM3okGLjqsX/f 3Pdh5XvadAsKGXu8zvH7UP1+jcemR8g4ah4vyndYo1syWDvRWnj1GUHDTlLplU1uHj3L jyq4nuWhFSgW27miLQiuXen314MyiYaT6N06LmuMYySOrY1A7VoKUbQPyAVbcti6Vwsz JL0Ft/A3ANzOJccnEpjX/MUKXAW7ULMc0pxRTV6I7MeEv/vbc8N6g3wIN9v5ygNpEXxr 0+xMtGFtAKrU2l70fYC27+u7sRUFVg+hV9Hk3IPLlJFALLvhBfepinfxym+pEcucObyT Ug0g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w15si2751647edx.158.2021.02.24.22.06.09; Wed, 24 Feb 2021 22:06:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236805AbhBYCoB (ORCPT + 99 others); Wed, 24 Feb 2021 21:44:01 -0500 Received: from mx2.suse.de ([195.135.220.15]:41984 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234384AbhBYCoB (ORCPT ); Wed, 24 Feb 2021 21:44:01 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 55655AE7A; Thu, 25 Feb 2021 02:43:19 +0000 (UTC) From: NeilBrown To: Steve Dickson Date: Thu, 25 Feb 2021 13:42:47 +1100 Subject: [PATCH 2/5] mountd: Don't proactively add export info when fh info is requested. Cc: Linux NFS Mailing list Message-ID: <161422096787.28256.6764678456311890448.stgit@noble> In-Reply-To: <161422077024.28256.15543036625096419495.stgit@noble> References: <161422077024.28256.15543036625096419495.stgit@noble> User-Agent: StGit/0.23 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: NeilBrown When an "nfsd.fh" request is received from the kernel, we map the file-handle prefix to a path name and report that (as required) and then also add "nfsd.export" information with export flags applicable to that path. This is not necessary and was added as a perceived optimisation. When updating data already in the kernel, it is unlikely to help as the kernel can be expected to ask for both details at much the same time. With NFSv3, new information is normally added by a MOUNT rpc request, so this is irrelevant. With NFSv4, the kernel requests the "nfsd.export" information when walking down from ROOT, *before* requesting the nfsd.fh information, so this "optimisation" causes unnecessary work. A future patch will add logging of authentication requests, and this double-handling would result in extra unnecessary log messages. As this "optimisation" appears to have no practical value and some (small) cost, let's remove it. Signed-off-by: NeilBrown --- support/export/cache.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/support/export/cache.c b/support/export/cache.c index 156ebfd4087c..49a761749ec6 100644 --- a/support/export/cache.c +++ b/support/export/cache.c @@ -96,7 +96,6 @@ static bool path_lookup_error(int err) * Record is terminated with newline. * */ -static int cache_export_ent(char *buf, int buflen, char *domain, struct exportent *exp, char *path); #define INITIAL_MANAGED_GROUPS 100 @@ -870,18 +869,13 @@ static void nfsd_fh(int f) !is_mountpoint(found->e_mountpoint[0]? found->e_mountpoint: found->e_path)) { - /* Cannot export this yet + /* Cannot export this yet * should log a warning, but need to rate limit xlog(L_WARNING, "%s not exported as %d not a mountpoint", found->e_path, found->e_mountpoint); */ /* FIXME we need to make sure we re-visit this later */ goto out; - } else if (cache_export_ent(buf, sizeof(buf), dom, found, found_path) < 0) { - if (!path_lookup_error(errno)) - goto out; - /* The kernel is saying the path is unexportable */ - found = NULL; } bp = buf; blen = sizeof(buf);