Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2942320pxb; Sun, 28 Feb 2021 19:24:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJy8DQ9As/zFfxrp+O6K5OdE8suMQ2vomj1U+44BAHQAZCwc80LBbWGLtTIeG44GhI7Q+0kF X-Received: by 2002:a17:906:3088:: with SMTP id 8mr13823139ejv.499.1614569040134; Sun, 28 Feb 2021 19:24:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614569040; cv=none; d=google.com; s=arc-20160816; b=xnrVbkTK83z3NDbvrX0aycpOg8DVk1HggKyt6AJhUKOJWpEySCm3mMIKOfgsQx0p0W BFr8Datuegd/qDeV5YHk7CatekxolMF8+/jDpqLUfIJbQFzRloFrHRqzeIGMYER3/VZe mTh5RbPD085lKY3lFrLFk/BtQWxCyBlraGNB5lniASvK5jf0zDJ/c6fi8D9llbAnQCu8 C9tIt4KLRwrIEc6PCneOd3SBdek6FJL/YFOFcRYeVKYh5tA1AjjoZFT9xACwD50U5L0q CiOD4kdIEl2oe9+CCSiY5SrC/xAPt5Wh6nNHRDDcROWd/7oyygvN+PzryNyY0UIK2Gdb 1ONw== 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=sXvZA0u0+g3RPpC6ihxDB7EVjxIjfnYNRlKncxj3uTbQtbRhR/U+oqDg5TWhzF2Tb+ jNU3HU6n3i94Q78DDnjuhbiU0wa0s6oXcD74e2BdVRoCV/9VXIxVhvtiHAb+vOn+nv1T YdBZEW0x6N/AFWtl7F/BimstukMFWoHaOxFY6LQe+sZWjKyNMSjaA2jW1Hxv6TnhVKHC yEFxcCw5EQkPRXSNhNes9CGUc+MzYE7ni4koXvQ3G3US/E2MoyZf5rgOo7fxj0pJ18np i50HmpPKv+MmS86dURBRyB6wIy1VwTyFBFUKPWNhyMH5iwIy6cLmupXKmPolQcEa4qzQ 4c1A== 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 8si10412005ejz.244.2021.02.28.19.23.25; Sun, 28 Feb 2021 19:24:00 -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 S231806AbhCACSa (ORCPT + 99 others); Sun, 28 Feb 2021 21:18:30 -0500 Received: from mx2.suse.de ([195.135.220.15]:58482 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231802AbhCACS3 (ORCPT ); Sun, 28 Feb 2021 21:18:29 -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 E73D5AF77; Mon, 1 Mar 2021 02:17:47 +0000 (UTC) From: NeilBrown To: Steve Dickson Date: Mon, 01 Mar 2021 13:17:15 +1100 Subject: [PATCH 2/5] mountd: Don't proactively add export info when fh info is requested. Cc: Linux NFS Mailing list Message-ID: <161456503508.22801.10952444290383474947.stgit@noble> In-Reply-To: <161456493684.22801.323431390819102360.stgit@noble> References: <161456493684.22801.323431390819102360.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);