From patchwork Mon Nov 20 18:53:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever X-Patchwork-Id: 13461926 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F1634C2BB3F for ; Mon, 20 Nov 2023 18:53:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229637AbjKTSxs (ORCPT ); Mon, 20 Nov 2023 13:53:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50882 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232156AbjKTSxr (ORCPT ); Mon, 20 Nov 2023 13:53:47 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2B56FED for ; Mon, 20 Nov 2023 10:53:41 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9F907C433C8; Mon, 20 Nov 2023 18:53:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1700506420; bh=2vp4Zufz1kBPECgcRpwM9djHLwFN7C4H49D2rU0hcoo=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=nU+5DoZgcQudghMy5eu5H9SIcdivi9SAyLal0+wGqAo3f+1nYbOCO8BIPXZVsa8T8 zj2lWAJRkBamgPUP46ofDuidltsVraT2HfjUHNGOkPhZZvNdhLjUnI/afK4F2OPCZO mgeMVXS3cS2Wg3Py+wARrvZa8oskoeEQmxD6eEHCpSvmme2S0y2blAZPysS8px1NxG nmfpbX3cVP6mSeHXFiMILWwgRHjrz5/D889RGfuNlOOVORxiMqXtOZpsflWVVRIFuV FBQ8WenH8G1CfDnaP9HB1J0fY68x9zBCycT/mtbGfJ9G0srGp/IyhHD20Pv4D7C+Ne nDxs4eSM4z5TQ== Subject: [PATCH RFC 1/5] junction: Replace xmlParseMemory From: Chuck Lever To: linux-nfs@vger.kernel.org Cc: Chuck Lever Date: Mon, 20 Nov 2023 13:53:39 -0500 Message-ID: <170050641955.123525.14000282753998469753.stgit@manet.1015granger.net> In-Reply-To: <170050610386.123525.8429348635736141592.stgit@manet.1015granger.net> References: <170050610386.123525.8429348635736141592.stgit@manet.1015granger.net> User-Agent: StGit/1.5 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: Chuck Lever According to: https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-parser.html#xmlParseMemory xmlParseMemory() is deprecated. Replace the one call site with a call to xmlReadMemory(). Signed-off-by: Chuck Lever --- support/junction/xml.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/support/junction/xml.c b/support/junction/xml.c index 813110b4f308..ec9586528cc9 100644 --- a/support/junction/xml.c +++ b/support/junction/xml.c @@ -290,7 +290,7 @@ junction_parse_xml_buf(const char *pathname, const char *name, { xmlDocPtr tmp; - tmp = xmlParseMemory(buf, (int)len); + tmp = xmlReadMemory(buf, (int)len, NULL, NULL, 0); if (tmp == NULL) { xlog(D_GENERAL, "Failed to parse XML in %s(%s)\n", pathname, name); From patchwork Mon Nov 20 18:53:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever X-Patchwork-Id: 13461927 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0CEEFC197A0 for ; Mon, 20 Nov 2023 18:53:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230229AbjKTSxv (ORCPT ); Mon, 20 Nov 2023 13:53:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51026 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229676AbjKTSxu (ORCPT ); Mon, 20 Nov 2023 13:53:50 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9C37BC8 for ; Mon, 20 Nov 2023 10:53:47 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1EBE5C433C8; Mon, 20 Nov 2023 18:53:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1700506427; bh=My3stO6oFd/9rUFAB5HQqsIZaehpceYJCE0n7ue6+Z0=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=VNk3X4rUaTsIE4vtFNDaYxx5AB+OLre6frEn3k7K5pUBQDP7+4IHBzAPSg9xNXQy2 f3XREFMuWJc25k85clbwApX1pDwUAUpY6MZTSr/Cc9W3pEfed8on3OMKT6BWGaRxFh w94gXMUXbsttLFpDRpL9z7kw6rHRNjkqW0WKQGszztxv9NUEl1od3z2Vz7vG6BlZwW NhGHLs2avpcv8B3d7fmxhj/JaPOE1In4DW4FHRo1n6+9ZdQBadOfUI88YDntOuqYto 10r+2etsTY2SWElN1b0sczFcD4GNRZUUXQCz5aAYlpqqB8S6Re5BdpgCU3Y9eNCJ+d +PQjpR8/2n78w== Subject: [PATCH RFC 2/5] junction: Remove xmlIndentTreeOutput From: Chuck Lever To: linux-nfs@vger.kernel.org Cc: Chuck Lever Date: Mon, 20 Nov 2023 13:53:46 -0500 Message-ID: <170050642602.123525.1034811730816028179.stgit@manet.1015granger.net> In-Reply-To: <170050610386.123525.8429348635736141592.stgit@manet.1015granger.net> References: <170050610386.123525.8429348635736141592.stgit@manet.1015granger.net> User-Agent: StGit/1.5 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: Chuck Lever Though it doesn't seem to be marked deprecated, xmlIndentTreeOutput does not appear in recent versions of libxml2. Since xmlIndentTreeOutput = 1; should be the default behavior now, we can remove this statement without a behavior change. Signed-off-by: Chuck Lever --- support/junction/xml.c | 1 - 1 file changed, 1 deletion(-) diff --git a/support/junction/xml.c b/support/junction/xml.c index ec9586528cc9..aef1cbbd74d3 100644 --- a/support/junction/xml.c +++ b/support/junction/xml.c @@ -387,7 +387,6 @@ junction_xml_write(const char *pathname, const char *name, xmlDocPtr doc) return retval; retval = FEDFS_ERR_SVRFAULT; - xmlIndentTreeOutput = 1; xmlDocDumpFormatMemoryEnc(doc, &buf, &len, "UTF-8", 1); if (len < 0) goto out; From patchwork Mon Nov 20 18:53:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever X-Patchwork-Id: 13461928 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4FCBFC197A0 for ; Mon, 20 Nov 2023 18:53:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229676AbjKTSx6 (ORCPT ); Mon, 20 Nov 2023 13:53:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37226 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232057AbjKTSx5 (ORCPT ); Mon, 20 Nov 2023 13:53:57 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 12B32C8 for ; Mon, 20 Nov 2023 10:53:54 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7C840C433C7; Mon, 20 Nov 2023 18:53:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1700506433; bh=eGyIrNTj7pbOO2tlVeH6Wc8JZexBe7MgisoSTCCEAJw=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=QFpxbFrMwhDnLBkp46leVaankL73P1Zih9x7iJo4WVr5aUffOF2/b0XOos7Fg941n HNGVPxUAyshjrTo9J9QlrVf3Ty+iIhWRqwLJtr9jjfcj6yIfRirq9hBHS6pB17DD17 +y7Uk8/wENPpMLnvrfSh9zY0ihlYWMaWf+aGZ1R2Xmil49EuzrTEfGGQqXOZ4YmFuM kdE/TCXiYXwqNjy9bxqY8CDAjbTL/CMgRfxvR2WMoi65zTr8tsH88xzEcPUZi4OBO7 /5mrILosPOp5pPTgKRP/MBotJ1QTj7d3QWAZjwm6Qi8ULzI0pZ9BS7Tt/oiQ3hqQK9 JIo6Vefwal4Rw== Subject: [PATCH RFC 3/5] nfsref: Remove unneeded #include in utils/nfsref/nfsref.c From: Chuck Lever To: linux-nfs@vger.kernel.org Cc: Chuck Lever Date: Mon, 20 Nov 2023 13:53:52 -0500 Message-ID: <170050643249.123525.7457995133948275163.stgit@manet.1015granger.net> In-Reply-To: <170050610386.123525.8429348635736141592.stgit@manet.1015granger.net> References: <170050610386.123525.8429348635736141592.stgit@manet.1015granger.net> User-Agent: StGit/1.5 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: Chuck Lever Neil Brown says: > The only thing that was interesting is that nfsref.c includes > sys/capability.h, and I didn't have libcap declared as BuildRequires. > The ./configure script didn't complain that libcap was missing - instead > the build failed. > > Other places in nfs-utils that include capability.h protect it with > #ifdef HAVE_SYS_CAPABILITY_H > > If nfsref.c followed that pattern I wouldn't have received an error. > But then I wouldn't have added a dependency on libcap. > Do I really want libcap?? I don't know. > But I cannot see where nfsref.c uses libcap or prctl. So maybe > those includes aren't needed. Signed-off-by: Chuck Lever --- utils/nfsref/nfsref.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/utils/nfsref/nfsref.c b/utils/nfsref/nfsref.c index 7f97d01f55ca..aa8414b425fb 100644 --- a/utils/nfsref/nfsref.c +++ b/utils/nfsref/nfsref.c @@ -24,8 +24,6 @@ */ #include -#include -#include #include #include From patchwork Mon Nov 20 18:53:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever X-Patchwork-Id: 13461929 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4C99FC2BB3F for ; Mon, 20 Nov 2023 18:54:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232057AbjKTSyE (ORCPT ); Mon, 20 Nov 2023 13:54:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51932 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231895AbjKTSyD (ORCPT ); Mon, 20 Nov 2023 13:54:03 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 63499CD for ; Mon, 20 Nov 2023 10:54:00 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D5742C433C8; Mon, 20 Nov 2023 18:53:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1700506440; bh=wH8+ABfImSH1anKlpGvfw6l9o3CrTtDa9WKQyMNkuIs=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=oFDgVmVvHJ3Nz+PQKJ2iA1VuoL0eNAWgOnB4nYg1LkBNmdHU+plklZZI0fRjC5IN8 OvkOau/aqd4Mp3NxVvGvwdd/NSKK+JWXPyJ4Mb9I5CqWaEcuTrLiqKfMSLRXg/4jMh A1m8cdkwotEFZfyS7w5O2tTVK5seD6SQTkQQKEx2Me0ZoBY+2FE/Rgc4iRiBwsBKWZ dyWLquaEPJN9qlXamE1zLp5zKUd1+cMiEgYutMnb+j9/CtU7YKye7RRGT7SIFN2k6J AE4v0C+tsYnREfsLhPCTHty8mKiqi//jc7R0sII9uFOjTLh4b2Diu+aTC+Cvz0zic2 aRQzxdaMUZRAw== Subject: [PATCH RFC 4/5] nfsref: Improve nfsref(5) From: Chuck Lever To: linux-nfs@vger.kernel.org Cc: Chuck Lever Date: Mon, 20 Nov 2023 13:53:58 -0500 Message-ID: <170050643888.123525.15735019118169614157.stgit@manet.1015granger.net> In-Reply-To: <170050610386.123525.8429348635736141592.stgit@manet.1015granger.net> References: <170050610386.123525.8429348635736141592.stgit@manet.1015granger.net> User-Agent: StGit/1.5 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: Chuck Lever Neil Brown says: > ... I found the man page a bit confusing. It starts off talking about > "referrals", which are suitably defined. Then drifts into talking about > "junctions" which might be the same thing, but aren't defined. > > The intro suggests that the admin can use "refer=" in /etc/exports, but > doesn't say why they might want to use "nfsref" instead, or how the two > relate. > > Description says "Other administrative commands provide richer access to > junction information." but there are no pointers in "See Also". > > The --type option, we are told, can specify nfs-fedfs but there is no > further mention of this, or any pointers to more info. Maybe add > "(deprecated)"?? Signed-off-by: Chuck Lever --- utils/nfsref/nfsref.man | 60 ++++++++++++++++++++++++----------------------- 1 file changed, 31 insertions(+), 29 deletions(-) diff --git a/utils/nfsref/nfsref.man b/utils/nfsref/nfsref.man index 12615497a404..1970f9dd4144 100644 --- a/utils/nfsref/nfsref.man +++ b/utils/nfsref/nfsref.man @@ -53,33 +53,37 @@ nfsref \- manage NFS referrals NFS version 4 introduces the concept of .I file system referrals to NFS. -A file system referral is like a symbolic link on a file server -to another file system share, possibly on another file server. -On an NFS client, a referral behaves like an automounted directory. -The client, under the server's direction, mounts a new NFS export -automatically when an application first accesses that directory. .P -Referrals are typically used to construct a single file name space -across multiple file servers. -Because file servers control the shape of the name space, -no client configuration is required, -and all clients see the same referral information. +A file system referral is like a symbolic link +(or, +.IR symlink ) +to another file system share, typically on another file server. +An NFS client, under the server's direction, +mounts the referred-to NFS export +automatically when an application first accesses it. .P -The Linux NFS server supports NFS version 4 referrals. -Administrators can specify the -.B refer= -export option in -.I /etc/exports -to configure a list of exports from which the client can choose. -See -.BR exports (5) -for details. +NFSv4 referrals can be used to transparently redirect clients +to file systems that have been moved elsewhere, or +to construct a single file name space across multiple file servers. +Because file servers control the shape of the whole file name space, +no client configuration is required. .P .SH DESCRIPTION +A +.I junction +is a file system object on an NFS server that, +when an NFS client encounters it, triggers a referral. +Similar to a symlink, a junction contains one or more target locations +that the server sends to clients in the form of an NFSv4 referral. +.P +On Linux, an existing directory can be converted to a junction +and back atomically and without the loss of the directory contents. +When a directory acts as a junction, it's local content is hidden +from NFSv4 clients. +.P The .BR nfsref (8) -command is a simple way to get started managing junction metadata. -Other administrative commands provide richer access to junction information. +command is a simple way to get started managing junctions and their content. .SS Subcommands Valid .BR nfsref (8) @@ -135,6 +139,10 @@ For the .B add subcommand, the default value if this option is not specified is .BR nfs-basic . +The +.B nfs-fedfs +type is not used in this implementation. +.IP For the .B remove and @@ -163,18 +171,12 @@ you might issue this command as root: .sp # mkdir /home .br -# nfsref --type=nfs-basic add /home home.example.net / +# nfsref add /home home.example.net / .br Created junction /home. .sp .RE -.SH FILES -.TP -.I /etc/exports -NFS server export table .SH "SEE ALSO" -.BR exports (5) -.sp -RFC 5661 for a description of NFS version 4 referrals +RFC 8881 for a description of the NFS version 4 referral mechanism .SH "AUTHOR" Chuck Lever From patchwork Mon Nov 20 18:54:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever X-Patchwork-Id: 13461930 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 24528C197A0 for ; Mon, 20 Nov 2023 18:54:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231895AbjKTSyK (ORCPT ); Mon, 20 Nov 2023 13:54:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51994 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232307AbjKTSyK (ORCPT ); Mon, 20 Nov 2023 13:54:10 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B794ACD for ; Mon, 20 Nov 2023 10:54:06 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 343B1C433C8; Mon, 20 Nov 2023 18:54:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1700506446; bh=fKPlj3s/zKwZeZMuf6ZpyA9QY8rtitPYtb7JhHNAMew=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=XyxAyNwMOUf9b1QX8NIOXQeBCTCM930C5Qoql+eF61lH6nNUG6Mn/F2/nps1H0GY+ EGYXbaiEQrRqQJCEoZ5VrsSsGuJnzBaru1jxOT4riK7x0WmEmRAEROeIjcPAKVKGMV 3dJC3QkvDPHK8aWjOYozp6cgp4KnTKwyJobYhuSNHBSWuMYP3R3f0Gu2+Xrzb0/ZBK zUkU7DGXyfue2PFY8WzPChj927Plv71ofbNm27qDqxxIZe7m23J558N/LMiy2FdBuc +sFvtyFW11UT+S+HYP0autIpDmcdpZ+Xvmfa2i6D1G/Ag36WxzJM/Kuu+FlqLH/+/y DxS7eTlLRFB/A== Subject: [PATCH RFC 5/5] configure: Make --enable-junction=yes the default From: Chuck Lever To: linux-nfs@vger.kernel.org Cc: Chuck Lever Date: Mon, 20 Nov 2023 13:54:05 -0500 Message-ID: <170050644526.123525.5665867726938404920.stgit@manet.1015granger.net> In-Reply-To: <170050610386.123525.8429348635736141592.stgit@manet.1015granger.net> References: <170050610386.123525.8429348635736141592.stgit@manet.1015granger.net> User-Agent: StGit/1.5 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: Chuck Lever When I first introduced the nfsref command as part of fedfs-utils, Bruce suggested that we should adopt nfsref as the mechanism for managing NFSv4 referrals, over the existing refer= and replica= export options. Now that nfsref has been an integral part of nfs-utils for several years, it's time to take the next step toward that goal: ensure that the nfsref command (and the appropriate logic inside of mountd) is built and available by default. Signed-off-by: Chuck Lever --- configure.ac | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 4ade528d72e8..e95075671571 100644 --- a/configure.ac +++ b/configure.ac @@ -175,14 +175,14 @@ else fi AC_ARG_ENABLE(sbin-override, - [AS_HELP_STRING([--disable-sbin-override],[Don't force nfsdcltrack and mount helpers into /sbin: always honour --sbindir])], + [AS_HELP_STRING([--disable-sbin-override],[Do not force nfsdcltrack and mount helpers into /sbin: always honour --sbindir])], enable_sbin_override=$enableval, enable_sbin_override=yes) AM_CONDITIONAL(CONFIG_SBIN_OVERRIDE, [test "$enable_sbin_override" = "yes"]) AC_ARG_ENABLE(junction, - [AS_HELP_STRING([--enable-junction],[enable support for NFS junctions @<:@default=no@:>@])], + [AS_HELP_STRING([--enable-junction],[enable support for NFS junctions @<:@default=yes@:>@])], enable_junction=$enableval, - enable_junction=no) + enable_junction=yes) if test "$enable_junction" = yes; then AC_DEFINE(HAVE_JUNCTION_SUPPORT, 1, [Define this if you want junction support compiled in])