Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp238705iob; Mon, 2 May 2022 18:09:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwYA0LeTb2i7a49QHOJS3A/E3fqFGBz96Poh3PSA/BCtTEZYk0w5FigUKEziHZp9RXIaFXB X-Received: by 2002:a17:90a:9ea:b0:1dc:1c48:eda with SMTP id 97-20020a17090a09ea00b001dc1c480edamr2101766pjo.38.1651540178936; Mon, 02 May 2022 18:09:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651540178; cv=none; d=google.com; s=arc-20160816; b=vURLX1ihX0a6kyQBzp8PyXcjSB4uOONC787+xYeNx9rdOAno9AgNg3MWf+gB4iw3+W rAqaXk0ENrDtcbm0nzMLDwFu3EJNyB7cgOgRj6fuIt5kiUinl/Jwy2956srtC8LyHFYl nRPLRNZVGquJRP2Dohm34d3k3mNazJ/P1F0iRvWqnWkTyG7ctUmAWYskzuO311WkH76d rC2SiH6eCmiOjKKs/GmB7SDLf5CLVQHrIbKUqhAMn6KKUGqB7LHBFqphPqnk9fOZ3HIR Ktl6EC1a5GaQ4Fk37hAnkqaBWg8DDHvlvRn8c/+opMhP4gJsc7PJ1yV6HBGToM8StdPO 2Bjw== 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 :message-id:date:subject:cc:to:from; bh=LxEswk7xh3cVYvjUY/Sx2cFPi+CCFs1q5l0IWmxlF9E=; b=Td0hs3G8cmqK6qYbD+iklE12Qri9h201QUiYLqPecnQRtLPAhI40TdFjhokM3Eyk5g NHc8ulYxTUI2S33Socg49PbeVDq0vE3ztUEO0lUeo2cqoEVHEGzD2aC53zGbNLPzgOh6 sWzGtz+5Zvebd3roA8va1wNCnnKIMhUQte2s5uUuC7kJXJmx+h6sFiSZG1cTr7ltHBHC TBO1t5oqJ1sZRDshfNA3P9/E+4/LVNEJY6bVLGI87/KP6q9jnl5YjcroxRnEpXqjHHn4 CauFn4FhYNwNkF/ozSWA5R0W+0QGy9oshr+a1xZWmsNRxrt/yDlJUw9zqHAJOUlzA0nX 9Oyg== 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:18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id r17-20020a632051000000b003aa8b5bae5asi15736843pgm.779.2022.05.02.18.09.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 May 2022 18:09:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id F419C3BBE1; Mon, 2 May 2022 17:51:32 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1383907AbiEBIzN (ORCPT + 99 others); Mon, 2 May 2022 04:55:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34760 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1383935AbiEBIzL (ORCPT ); Mon, 2 May 2022 04:55:11 -0400 Received: from lithops.sigma-star.at (lithops.sigma-star.at [195.201.40.130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B323613D7F for ; Mon, 2 May 2022 01:51:33 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by lithops.sigma-star.at (Postfix) with ESMTP id 13F0E6081107; Mon, 2 May 2022 10:51:30 +0200 (CEST) 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 EprieeZUBtX5; Mon, 2 May 2022 10:51:28 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by lithops.sigma-star.at (Postfix) with ESMTP id 22A0E6081104; Mon, 2 May 2022 10:51:28 +0200 (CEST) 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 4oUXqAGU8Cth; Mon, 2 May 2022 10:51:28 +0200 (CEST) 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 9752A608F44C; Mon, 2 May 2022 10:51:27 +0200 (CEST) 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, steved@redhat.com, chris.chilvers@appsbroker.com, Richard Weinberger Subject: [PATCH 0/5] nfs-utils: Improving NFS re-exports Date: Mon, 2 May 2022 10:50:40 +0200 Message-Id: <20220502085045.13038-1-richard@nod.at> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 is the first non-RFC iteration of the NFS re-export improvement series for nfs-utils. While the kernel side[0] didn't change at all and is still small, the userspace side saw much more changes. The core idea is adding new export option: reeport=3D Using reexport=3D it is possible to mark an export entry in the exports file explicitly as NFS re-export and select a strategy how unique identifiers should be provided. Currently two strategies are supported, "auto-fsidnum" and "predefined-fsidnum", both use a SQLite database as backend to keep track of generated ids. For a more detailed description see patch "exports: Implement new export = option reexport=3D". I choose SQLite because nfs-utils already uses it and using SQL ids can n= icely generated and maintained. It will also scale for large setups where the a= mount of subvolumes is high. Beside of id generation this series also addresses the reboot problem. If the re-exporting NFS server reboots, uncovered NFS subvolumes are not = yet mounted and file handles become stale. Now mountd/exportd keeps track of uncovered subvolumes and makes sure the= y get uncovered while nfsd starts. The whole set of features is currently opt-in via --enable-reexport. I'm also not sure about the rearrangement of the reexport code, currently it is a helper library. A typical export entry on a re-exporting server looks like: /nfs *(rw,no_root_squash,no_subtree_check,crossmnt,reexport=3Dauto-fsidn= um) reexport=3Dauto-fsidnum will automatically assign an fsid=3D to /nfs and = all uncovered subvolumes. Richard Weinberger (5): Implement reexport helper library exports: Implement new export option reexport=3D export: Implement logic behind reexport=3D export: Avoid fsid=3D conflicts reexport: Make state database location configurable [0] https://git.kernel.org/pub/scm/linux/kernel/git/rw/misc.git/log/?h=3D= nfs_reexport_clean configure.ac | 12 ++ nfs.conf | 3 + support/Makefile.am | 4 + support/export/Makefile.am | 2 + support/export/cache.c | 71 ++++++- support/export/export.c | 27 ++- support/include/nfslib.h | 1 + support/nfs/Makefile.am | 1 + support/nfs/exports.c | 68 +++++++ support/reexport/Makefile.am | 6 + support/reexport/reexport.c | 354 +++++++++++++++++++++++++++++++++ support/reexport/reexport.h | 39 ++++ systemd/Makefile.am | 4 + systemd/nfs-server-generator.c | 14 +- systemd/nfs.conf.man | 6 + utils/exportd/Makefile.am | 8 +- utils/exportd/exportd.c | 5 + utils/exportfs/Makefile.am | 6 + utils/exportfs/exportfs.c | 21 +- utils/exportfs/exports.man | 31 +++ utils/mount/Makefile.am | 7 + utils/mountd/Makefile.am | 6 + utils/mountd/mountd.c | 1 + utils/mountd/svc_run.c | 6 + 24 files changed, 690 insertions(+), 13 deletions(-) create mode 100644 support/reexport/Makefile.am create mode 100644 support/reexport/reexport.c create mode 100644 support/reexport/reexport.h --=20 2.31.1