Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1686213pxj; Wed, 19 May 2021 11:27:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw/RahpL2rihWiBeb+eqLTrIX9YjzZ/0Bp2GSYPwWh7ITE5Zm2FhqZCwskwnttkfLfxMvgi X-Received: by 2002:a6b:ec03:: with SMTP id c3mr882217ioh.103.1621448839761; Wed, 19 May 2021 11:27:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621448839; cv=none; d=google.com; s=arc-20160816; b=NE1dAwZ5nceR//bz85fM1IDDstO+oeONAsIPWD6OXpmHsEZEhKJ1LzfPuDUBQ1EnQG mezigtcPhZSi7HJmIHNhF4wgdyaPJgrJoppumuEwWzYUp0ARO5tMvSeSU5hmyujRcj/3 hpNql6DCIKX86f0MGSTKP0zGBta1Gc747rDBQJRp6inaLEYEdEoeq4pC+SWaHsexhY2B sj1DLZjd6EyPd9NnhYbod0QMLVgoyRscN9Jy+PPDn23Bxycstq/ZDYLHcbQAQWkzcmEP +R/M2RgVFexvj53u047+JxyWw9jkrWqkvXNq5cVohYNbNYfFhyWWPRBcA3JTcx8WQTkQ BI2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:reply-to:message-id:subject:cc:to:from:date; bh=7SfghBOGh8yQbfKNitAA/RnuGQab7EmiQP97vgn3R/I=; b=N8joHPRVKx1xyR5SW43uLDZe4kZLfGD398WfTKdGDUEic3b6cdtDlw0mMPZsFTudI6 Choue/ATGKosfBNuG+fqZ8MrdWYM815dBRasp2Wa94tkMNEuHpfPZvXr11KmBszF/zqJ RgT04GInocvhmO8tKaO3EcVHC7CK1oqYWaS0TqacUxuFvuVzZIkqhdjZDrVrU8pOEWhx EAXgv3dg/JZDCQtw9EHMK9byI3dMJ4jSSoUDlq5iU1bYkplowtxo7iLvxWyPq8smCIGa ajuHkYtKCqMI2TnI53RsozUV38NxsmRzW4PwAfXZ4hsPb8/0OdVxeMC7UvsTkISFli8q stgg== 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 x7si13547jat.98.2021.05.19.11.27.06; Wed, 19 May 2021 11:27:19 -0700 (PDT) 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 S1351188AbhERRzY (ORCPT + 99 others); Tue, 18 May 2021 13:55:24 -0400 Received: from mx2.suse.de ([195.135.220.15]:39038 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345673AbhERRzY (ORCPT ); Tue, 18 May 2021 13:55:24 -0400 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 80E4DAD8D; Tue, 18 May 2021 17:54:04 +0000 (UTC) Date: Tue, 18 May 2021 19:54:02 +0200 From: Petr Vorel To: NeilBrown Cc: "J . Bruce Fields" , linux-nfs@vger.kernel.org, Steve Dickson , Chuck Lever , Alexey Kodanev Subject: Re: [PATCH/RFC v2 nfs-utils] Fix NFSv4 export of tmpfs filesystems. Message-ID: Reply-To: Petr Vorel References: <20210422191803.31511-1-pvorel@suse.cz> <20210422202334.GB25415@fieldses.org> <162035212343.24322.12361160756597283121@noble.neil.brown.name> <162122673178.19062.96081788305923933@noble.neil.brown.name> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <162122673178.19062.96081788305923933@noble.neil.brown.name> Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Hi Neil, > Some filesystems cannot be exported without an fsid or uuid. > tmpfs is the main example. > When mountd (or exportd) creates nfsv4 pseudo-root exports for the path > leading down to an export point it exports each directory without any > fsid or uuid. If one of these directories is on tmp, that will fail. ^ nit: you probably mean tmpfs > The net result is that exporting a subdirectory of a tmpfs filesystem > will not work over NFSv4 as the parents within the filesystem cannot be > exported. It will either fail, or fall-back to NFSv3 (depending on the > version of the mount.nfs program). > To fix this we need to provide an fsid or uuid for these pseudo-root > exports. This patch does that by creating an RFC-4122 V5 compatible > UUID based on an arbitrary seed and the path to the export. > To check if an export needs a uuid, text_export() is moved from exportfs > to libexport.a, modified slightly and renamed to export_test(). > Signed-off-by: NeilBrown Reported-by: Petr Vorel Reviewed-by: Petr Vorel Tested-by: Petr Vorel LGTM, thanks for fixing it. ... > --- a/support/include/exportfs.h > +++ b/support/include/exportfs.h > @@ -173,5 +173,6 @@ struct export_features { > struct export_features *get_export_features(void); > void fix_pseudoflavor_flags(struct exportent *ep); > char *exportent_realpath(struct exportent *eep); > +int export_test(struct exportent *eep, int with_fsid); > #endif /* EXPORTFS_H */ > diff --git a/utils/exportd/Makefile.am b/utils/exportd/Makefile.am > index eb521f15032d..c95bdee76d3f 100644 > --- a/utils/exportd/Makefile.am > +++ b/utils/exportd/Makefile.am > @@ -16,7 +16,7 @@ exportd_SOURCES = exportd.c > exportd_LDADD = ../../support/export/libexport.a \ > ../../support/nfs/libnfs.la \ > ../../support/misc/libmisc.a \ > - $(OPTLIBS) $(LIBBLKID) $(LIBPTHREAD) > + $(OPTLIBS) $(LIBBLKID) $(LIBPTHREAD) -luuid I wonder if configure.ac should have libuuid check as it's now mandatory, e.g.: AC_CHECK_LIB[uuid], uuid_parse, [LIBUUID="-luuid"], AC_MSG_ERROR([libuuid needed])) Kind regards, Petr