aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeilBrown <neil@brown.name>2021-03-15 09:39:59 -0400
committerSteve Dickson <steved@redhat.com>2021-03-15 10:37:51 -0400
commitfec7347e930a9e989045eaf684694f793c802246 (patch)
tree8a95c8ab7e8108a75f987e5d6b2bcea104304605
parenta72c151f38bd5de2261c54ca8cbe2c4d3d5d7a0f (diff)
downloadnfs-utils-fec7347e930a9e989045eaf684694f793c802246.tar.gz
mountd: Don't proactively add export info when fh info is requested.
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 <neil@brown.name> Signed-off-by: Steve Dickson <steved@redhat.com>
-rw-r--r--support/export/cache.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/support/export/cache.c b/support/export/cache.c
index 156ebfd4..49a76174 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);