Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp351323pxb; Thu, 17 Feb 2022 05:39:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJyk/dzt5csyLORDMYIe4CcxpcbSOIw5hjvHBBFWWR9G0Yt+tGp2KPQlxznGBh858YcV743q X-Received: by 2002:a05:6a00:2313:b0:4e0:ffa7:bbe0 with SMTP id h19-20020a056a00231300b004e0ffa7bbe0mr2946498pfh.53.1645105156667; Thu, 17 Feb 2022 05:39:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645105156; cv=none; d=google.com; s=arc-20160816; b=rK9lpEf3yyVL+y5t6jfGzrSn14Pa/yTso1Zy+hZaOaaVet33YruQcGwbC7qCWaBn/H 0/sQ6HnZpB3GsPCz5M4bnKMY2fzC6VxdPLMdyDGEd8NYHBdD40AGv4WjhT7THmfdEb+v DdibXGhwaqE6CuXXZcK+52XZ1ltzmYw0RCc3VdtzYGM1jBst3DtkmF08aEXRqEdg3YSg SAST8XLfsfQIJUfMFgUKGEa/PFeWcIwORqBI1Zm45tiJo4EuoPRyWNa/E0wIsKwv5irZ zQQOTGfNJe8xT0UQac5do7QXnbHeB5s/V47Keu9/7WZhxwv4nz6IfuHJXB87Q5FcA4o1 8Llg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=rg+oS0KupUlmFjis9Hbp6Ws0GpuVSc8H5exU0wLNA2A=; b=jcZcH5XdLQfo5LGqCGe4Z7FBG2b1Kfdr3yQxW6RzoiRPFJLfMa3ErmfJYID5+lnzAL pnN7tBE03Y/KK519/t1mImcIk185OMhv6G7wnGX086d1dnLaCBTFSk9eytCILFtOCGd0 c9NFcpD8sM1+LAz1N0HjJt3eZgSIrUyicjbQSBE3lk0MeSnp8LOPCQp7oBvk0orBn0ZJ H9quDliAUbPRsvDG+u3o3kiQhyvG4pOGhCn1/8JpNfTfcVF0iolo9By65ltNHGSPdIYl XVjRmDsU/E0sB6HKdsPRJ4Uadp2DcwZATmGSkWKUKIe7vYMMZ7EuNWRWo496yjWiT0zi r9cg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o17si6486096pfu.251.2022.02.17.05.38.09; Thu, 17 Feb 2022 05:39:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240885AbiBQNXN (ORCPT + 99 others); Thu, 17 Feb 2022 08:23:13 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:51266 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240882AbiBQNXM (ORCPT ); Thu, 17 Feb 2022 08:23:12 -0500 Received: from lithops.sigma-star.at (lithops.sigma-star.at [195.201.40.130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0190BAEF12 for ; Thu, 17 Feb 2022 05:22:56 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by lithops.sigma-star.at (Postfix) with ESMTP id 2125560F6B8E; Thu, 17 Feb 2022 14:16:41 +0100 (CET) Received: from lithops.sigma-star.at ([127.0.0.1]) by localhost (lithops.sigma-star.at [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id 7AdH86T1LhPA; Thu, 17 Feb 2022 14:16:40 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by lithops.sigma-star.at (Postfix) with ESMTP id 7AE3860D482C; Thu, 17 Feb 2022 14:16:40 +0100 (CET) Received: from lithops.sigma-star.at ([127.0.0.1]) by localhost (lithops.sigma-star.at [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id sDOCmXgzzmK9; Thu, 17 Feb 2022 14:16:40 +0100 (CET) Received: from blindfold.corp.sigma-star.at (213-47-184-186.cable.dynamic.surfer.at [213.47.184.186]) by lithops.sigma-star.at (Postfix) with ESMTPSA id E43C9605DEBB; Thu, 17 Feb 2022 14:16:39 +0100 (CET) From: Richard Weinberger To: linux-nfs@vger.kernel.org Cc: david@sigma-star.at, bfields@fieldses.org, luis.turcitu@appsbroker.com, david.young@appsbroker.com, david.oberhollenzer@sigma-star.at, trond.myklebust@hammerspace.com, anna.schumaker@netapp.com, chris.chilvers@appsbroker.com, Richard Weinberger Subject: [RFC PATCH 5/6] nfsd: statfs() every known subvolume upon start Date: Thu, 17 Feb 2022 14:15:30 +0100 Message-Id: <20220217131531.2890-6-richard@nod.at> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20220217131531.2890-1-richard@nod.at> References: <20220217131531.2890-1-richard@nod.at> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE,T_SPF_PERMERROR autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org This will trigger an automount of a subvolume and existing file handles will continue to work. Signed-off-by: Richard Weinberger --- utils/nfsd/Makefile.am | 6 ++++++ utils/nfsd/nfsd.c | 10 ++++++++++ 2 files changed, 16 insertions(+) diff --git a/utils/nfsd/Makefile.am b/utils/nfsd/Makefile.am index 8acc9a04..3acc8354 100644 --- a/utils/nfsd/Makefile.am +++ b/utils/nfsd/Makefile.am @@ -11,6 +11,12 @@ noinst_HEADERS =3D nfssvc.h nfsd_SOURCES =3D nfsd.c nfssvc.c nfsd_LDADD =3D ../../support/nfs/libnfs.la $(LIBTIRPC) =20 +if CONFIG_REEXPORT +nfsd_LDADD +=3D ../../support/reexport/libreexport.a $(LIBSQLITE) $(LIBP= THREAD) -lrt +endif + +nfsd_CPPFLAGS =3D -I$(top_srcdir)/support/reexport + MAINTAINERCLEANFILES =3D Makefile.in =20 ####################################################################### diff --git a/utils/nfsd/nfsd.c b/utils/nfsd/nfsd.c index b0741718..b5175f7a 100644 --- a/utils/nfsd/nfsd.c +++ b/utils/nfsd/nfsd.c @@ -29,6 +29,7 @@ #include "nfssvc.h" #include "xlog.h" #include "xcommon.h" +#include "reexport.h" =20 #ifndef NFSD_NPROC #define NFSD_NPROC 8 @@ -347,6 +348,15 @@ main(int argc, char **argv) exit(1); } =20 + /* + * Make sure that uncovered NFS subvolumes are present such that + * existing file handles continue working. + */ + if (reexpdb_init() =3D=3D 0) { + reexpdb_uncover_subvolumes(NULL); + reexpdb_destroy(); + } + /* make sure nfsdfs is mounted if it's available */ nfssvc_mount_nfsdfs(progname); =20 --=20 2.31.1