Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp482287rwb; Wed, 7 Dec 2022 00:45:41 -0800 (PST) X-Google-Smtp-Source: AA0mqf4yKEKV4xx0hUjG7y/TQ8CLhru/3xvZGiMKt9m3AsJ+t9wP/wTX+oti6YTGE5D55c+00B84 X-Received: by 2002:a17:903:2651:b0:189:acbc:f032 with SMTP id je17-20020a170903265100b00189acbcf032mr33931193plb.9.1670402740719; Wed, 07 Dec 2022 00:45:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670402740; cv=none; d=google.com; s=arc-20160816; b=kAclPqyzjwpqyVyyIUlKAbevgM6kZUabELZcpzq10johXG2Y961LI6E25oL1dtUq1x FIRUdKEtT3Vz73VgeiypohHZJGDAFFe+REu/OvSVFyanDBthqH1gIt/qEp13b9dFVWko x3IMhLXUSvUQhgmULKvqbXDdUybcgw+4jXillV/RdT2eIKlyJAvcSJ0o1nywzCzSEA4x fg56Cwof9O4rBhrVRJZQVOs/+Lg4A5rHRuv6BEAbUm3hXOwNeCWDbrLhYQLH6OCYUf02 fZQ5on/oqDdfOVQuGYE3RwxMXaAC/BIjRxWHARAPmYFYxKAE3D+yeDaiW9mm3O6Tmw9D u23g== 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=Ze6hc+gquij1LlTckabofi5fW2FytK5/p3tJfBoaYVg=; b=YGnKUZ+NiJ3SNDWhAB30lYukAi7L5fapxTqFTE7DsNFH8LmMSNXTvuwO1JHFn0iRpZ 09HtJNXT52dL7taHtDGvlTXICmDea7O8PoctGwV7cLaZfplFDzClIK5blHkZUBgPCq2V ToM0W/3sfV86Unh5UzTVqCvTOlKViRkFUkVLtD2lWzNP1EZStOdC4xATRk13uNgwtovF HzsHzZq8ESRx/bUTeG4fYXuTzP16IDU20XMnHHqhuTojUOZ6EUOJ+zk4DCoYOOYKHiYZ /DS9XAY9aIGikf5TRJTy3pYprkxmkXvwdaf8r8htngwno9rPh1qyLjhrM66Abid8N1VV o1mg== 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 p29-20020a056a000a1d00b0054114c6685asi21740284pfh.129.2022.12.07.00.45.22; Wed, 07 Dec 2022 00:45:40 -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 S229778AbiLGInc (ORCPT + 99 others); Wed, 7 Dec 2022 03:43:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39068 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229523AbiLGIna (ORCPT ); Wed, 7 Dec 2022 03:43:30 -0500 Received: from lithops.sigma-star.at (lithops.sigma-star.at [195.201.40.130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 99076A44E; Wed, 7 Dec 2022 00:43:27 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by lithops.sigma-star.at (Postfix) with ESMTP id C3E8F615CA0B; Wed, 7 Dec 2022 09:43:24 +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 SlEnw1moQhMV; Wed, 7 Dec 2022 09:43:24 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by lithops.sigma-star.at (Postfix) with ESMTP id 0D44F64BA9D7; Wed, 7 Dec 2022 09:43:24 +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 uI7tyEAeGD_P; Wed, 7 Dec 2022 09:43:23 +0100 (CET) Received: from blindfold.corp.sigma-star.at (unknown [82.150.214.1]) by lithops.sigma-star.at (Postfix) with ESMTPSA id 647F164BA9AE; Wed, 7 Dec 2022 09:43:23 +0100 (CET) From: Richard Weinberger To: linux-nfs@vger.kernel.org Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, jlayton@kernel.org, chuck.lever@oracle.com, anna@kernel.org, trond.myklebust@hammerspace.com, viro@zeniv.linux.org.uk, raven@themaw.net, chris.chilvers@appsbroker.com, david.young@appsbroker.com, luis.turcitu@appsbroker.com, david@sigma-star.at, benmaynard@google.com, Richard Weinberger Subject: [PATCH 0/3 v2] NFS: NFSD: Allow crossing mounts when re-exporting Date: Wed, 7 Dec 2022 09:43:06 +0100 Message-Id: <20221207084309.8499-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,SPF_HELO_NONE, 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 Currently when re-exporting a NFS share the NFS cross mount feature does not work [0]. This patch series outlines an approach to address the problem. Crossing mounts does not work for two reasons: 1. As soon the NFS client (on the re-exporting server) sees a different filesystem id, it installs an automount. That way the other filesystem will be mounted automatically when someone enters the directory. But the cross mount logic of KNFS does not know about automount. This patch series addresses the problem and teach both KNFSD and the exportfs logic of NFS to deal with automount. 2. When KNFSD detects crossing of a mount point, it asks rpc.mountd to in= stall a new export for the target mount point. Beside of authentication rpc.mou= ntd also has to find a filesystem id for the new export. Is the to be exporte= d filesystem a NFS share, rpc.mountd cannot derive a filesystem id from it = and refuses to export. In the logs you'll see errors such as: mountd: Cannot export /srv/nfs/vol0, possibly unsupported filesystem or f= sid=3D required To deal with that I've changed rpc.mountd to use generate and store fsids= [1]. Since the kernel side of my changes did change for a long time I decided = to try upstreaming it first. A 3rd iteration of my rpc.mountd will happen soon. [0] https://marc.info/?l=3Dlinux-nfs&m=3D161653016627277&w=3D2 [1] https://lore.kernel.org/linux-nfs/20220217131531.2890-1-richard@nod.a= t/ Changes since v1: https://lore.kernel.org/linux-nfs/20221117191151.14262-1-richard@nod.at/ - Use LOOKUP_AUTOMOUNT only when NFSEXP_CROSSMOUNT is set (Jeff Layton) Richard Weinberger (3): NFSD: Teach nfsd_mountpoint() auto mounts fs: namei: Allow follow_down() to uncover auto mounts NFS: nfs_encode_fh: Remove S_AUTOMOUNT check fs/namei.c | 6 +++--- fs/nfs/export.c | 2 +- fs/nfsd/vfs.c | 8 ++++++-- include/linux/namei.h | 2 +- 4 files changed, 11 insertions(+), 7 deletions(-) --=20 2.26.2