From patchwork Wed Dec 7 08:43:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Weinberger X-Patchwork-Id: 30696 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp59477wrr; Wed, 7 Dec 2022 00:45:22 -0800 (PST) X-Google-Smtp-Source: AA0mqf7j+3J9YsIuVkV3clb6z4q5rdWl1DDagY9mr5vZmJfZZCvZaA0lSSYKO06me964L0+5HL/K X-Received: by 2002:a17:902:7898:b0:188:584d:b6d4 with SMTP id q24-20020a170902789800b00188584db6d4mr74016602pll.170.1670402722143; Wed, 07 Dec 2022 00:45:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670402722; cv=none; d=google.com; s=arc-20160816; b=fWj35w0IaE7BZ2BEhRbp8OaoRC8S2GCEovR3CLA3T3JBgt++g9Xb/wwfexLcclNvL+ w2QRLF6/7vwthQEhBwUSCdBPsZErf+vKLYDXX9N2vD8ZDMLMH0ItLxxvnRI82lva8uvg t1ThBpJfBQdpU+5mJAiJ+ysVkrbd7HDV+Ax8hf/CHbDKH2YD8ug5SW/AfG7NKbSkR3X6 NRwVipgmSDsOSdWjxr+05htW3GOxwOOBwR99n8isbKaVRtsc1dAcsbfB0wG6l8EL8rRW TexdBelnPUFUmOlQpjIskQFYrRaQVyXPZhzoHJJ4Ci68gPOf3wnvPj9fFo0GEs2+8dg2 YV/w== 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=7J3Cf5V8jVpa8RhPn5NeaoBF71EbfxWm8CfazAJHL44=; b=E80cLfOwWBPi/gxPVJygY2VD/XruPHnn8Wig6tVxqFW4L5VqeWIwCI3GNyFXuSVfVK /8gmdUcpZNDQjPNb9Kxsci9TH2EZJQv0vf/g0Y2V2aC4UKq94eOgXDhc/zShzeDG4uNz zu7L19munuARWcPOL2F+YlVP3DEp+HTYDWCxr0wMOHwTg0aZDdSphE2hFfZiil13B8IC eJTlnsN3fSVyl/h+uZYW5FDkWXHWq1HjnA/OBlt6AJLhNHk2X6MXwKMzDeK5c0VyTkgV HtmATDySWPbtciebkrsOgRTvkLKkMO1sQTicIk1cGcJs/iGYTDAC6OfrErjZEGhTByk5 f8uw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v6-20020a170902b7c600b001782a6fbc7csi18289863plz.463.2022.12.07.00.45.08; Wed, 07 Dec 2022 00:45:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229546AbiLGInc (ORCPT + 99 others); Wed, 7 Dec 2022 03:43:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39072 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229486AbiLGIna (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 99751AE6C; 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 C919064BA9DB; 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 eZ5PZuGXfVPK; 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 7098F64BA9DA; 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 qyypJqZOdzsx; Wed, 7 Dec 2022 09:43:24 +0100 (CET) Received: from blindfold.corp.sigma-star.at (unknown [82.150.214.1]) by lithops.sigma-star.at (Postfix) with ESMTPSA id E3AA064BA9B1; 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 1/3] NFSD: Teach nfsd_mountpoint() auto mounts Date: Wed, 7 Dec 2022 09:43:07 +0100 Message-Id: <20221207084309.8499-2-richard@nod.at> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20221207084309.8499-1-richard@nod.at> References: <20221207084309.8499-1-richard@nod.at> MIME-Version: 1.0 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-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1751544204540917320?= X-GMAIL-MSGID: =?utf-8?q?1751544204540917320?= Currently nfsd_mountpoint() tests for mount points using d_mountpoint(), this works only when a mount point is already uncovered. In our case the mount point is of type auto mount and can be coverted. i.e. ->d_automount() was not called. Using d_managed() nfsd_mountpoint() can test whether a mount point is either already uncovered or can be uncovered later. Signed-off-by: Richard Weinberger --- fs/nfsd/vfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c index f650afedd67f..157f0df0e93a 100644 --- a/fs/nfsd/vfs.c +++ b/fs/nfsd/vfs.c @@ -160,7 +160,7 @@ int nfsd_mountpoint(struct dentry *dentry, struct svc_export *exp) return 1; if (nfsd4_is_junction(dentry)) return 1; - if (d_mountpoint(dentry)) + if (d_managed(dentry)) /* * Might only be a mountpoint in a different namespace, * but we need to check.