Skip to contentSkip to conversation

Add server-side support for junctions to nfs-utils

RFC PATCH In review Chuck Lever 3 participants 12 messages Jan 8, 2018 – Jan 11, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover Add server-side support for junctions to nfs-utils

THIS IS AN UNTESTED RFC SERIES. I'm posting this for review only.

A while back I announced the deprecation of fedfs-utils. There were a handful of components in fedfs-utils that we decided to keep. One of those keepers was the "nfsref" command. (The other was autofs support for /nfs4, which I hope Ian Kent is making progress on ;-)

This is an RFC patch series to introduce "nfsref" to nfs-utils, minus the overhead of the LDAP / FedFS machinery. It also adds a version of libnfsjunct which mountd can dynamically load to handle non-FedFS junctions, replacing the same part from fedfs-utils.

I didn't apply a lot of brain cells to this port, so it's perhaps a little larger than it needs to be. Still, it achieves a completely LDAP-free implementation. I'm interested in comments about the approach before I do more testing and refinement.

  ./configure --enable-junction --enable-caps

is needed before building.

Perhaps one thing that can be done is simply getting rid of the DLL and building junction support into mountd. I'm not sure if a transition period is necessary where the DLL is retained for a bit until fedfs-utils is entirely gone. Does anything but mountd use libnfsjunct ?

---

Chuck Lever (3):
Add LDAP-free version of libjunction to nfs-utils Add LDAP-free version of libnfsjunct to nfs-utils Add 'nfsref' command

 aclocal/libxml2.m4                   |   15 
 configure.ac                         |   12 
 support/Makefile.am                  |    4 
 support/include/Makefile.am          |    3 
 support/include/fedfs_admin.h        |  342 +++++++
 support/include/junction.h           |  124 +++
 support/include/nfs-plugin.h         |  101 ++
 support/junction/Makefile.am         |   40 +
 support/junction/display.c           |  159 +++
 support/junction/export-cache.c      |  118 +++
 support/junction/junction-internal.h |  121 +++
 support/junction/junction.c          |  494 +++++++++++
 support/junction/locations.c         |  131 +++
 support/junction/nfs-plugin.c        |  350 ++++++++
 support/junction/nfs.c               | 1564 ++++++++++++++++++++++++++++++++++
 support/junction/path.c              |  345 ++++++++
 support/junction/xml.c               |  401 +++++++++
 utils/Makefile.am                    |    4 
 utils/nfsref/Makefile.am             |   39 +
 utils/nfsref/add.c                   |  271 ++++++
 utils/nfsref/lookup.c                |  211 +++++
 utils/nfsref/nfsref.c                |  188 ++++
 utils/nfsref/nfsref.h                |   47 +
 utils/nfsref/nfsref.man              |  180 ++++
 utils/nfsref/remove.c                |  145 +++
 25 files changed, 5409 insertions(+)
 create mode 100644 aclocal/libxml2.m4
 create mode 100644 support/include/fedfs_admin.h
 create mode 100644 support/include/junction.h
 create mode 100644 support/include/nfs-plugin.h
 create mode 100644 support/junction/Makefile.am
 create mode 100644 support/junction/display.c
 create mode 100644 support/junction/export-cache.c
 create mode 100644 support/junction/junction-internal.h
 create mode 100644 support/junction/junction.c
 create mode 100644 support/junction/locations.c
 create mode 100644 support/junction/nfs-plugin.c
 create mode 100644 support/junction/nfs.c
 create mode 100644 support/junction/path.c
 create mode 100644 support/junction/xml.c
 create mode 100644 utils/nfsref/Makefile.am
 create mode 100644 utils/nfsref/add.c
 create mode 100644 utils/nfsref/lookup.c
 create mode 100644 utils/nfsref/nfsref.c
 create mode 100644 utils/nfsref/nfsref.h
 create mode 100644 utils/nfsref/nfsref.man
 create mode 100644 utils/nfsref/remove.c

--
Chuck Lever

#1 lore raw

RFC PATCH 2/3 Add LDAP-free version of libnfsjunct to nfs-utils

libnfsjunct is a dynamic library that mountd can load to enable the Linux NFS server to support junctions. This patch moves the non-LDAP parts of libnfsjunct into nfs-utils. This enables mountd to continue to recognize and support NFS basic junctions.

mountd works fine whether or not there is a libnfsjunct installed on the local system, just as it did before. Without libnfsjunct, junctions on the NFS server appear to NFS clients like weird directories.

---
 support/include/Makefile.am   |    1 
 support/include/nfs-plugin.h  |  101 ++++++++++++
 support/junction/Makefile.am  |    6 +
 support/junction/nfs-plugin.c |  350 +++++++++++++++++++++++++++++++++++++++++
 4 files changed, 458 insertions(+)
 create mode 100644 support/include/nfs-plugin.h
 create mode 100644 support/junction/nfs-plugin.c
support/include/Makefile.am +1 -0
index 11cb162..a207d21 100644
@@ -9,6 +9,7 @@ noinst_HEADERS = \
 	ha-callout.h \
 	junction.h \
 	misc.h \
+	nfs-plugin.h \
 	nfs_mntent.h \
 	nfs_paths.h \
 	nfslib.h \
support/include/nfs-plugin.h new file +101 -0

101 lines not on this page · raw message

support/junction/Makefile.am +6 -0
index 97e7426..9494f55 100644
@@ -29,6 +29,12 @@ noinst_LTLIBRARIES	= libjunction.la
 libjunction_la_SOURCES	= display.c export-cache.c junction.c \
 			  locations.c nfs.c path.c xml.c
 
+lib_LTLIBRARIES		= libnfsjunct.la
+libnfsjunct_la_SOURCES	= nfs-plugin.c
+libnfsjunct_la_LIBADD	= $(LIBXML2) \
+			  ../../support/nfs/libnfs.la \
+			  libjunction.la
+
 MAINTAINERCLEANFILES	= Makefile.in
 
 AM_CPPFLAGS		= -I. -I../include -I/usr/include/libxml2
support/junction/nfs-plugin.c new file +350 -0

350 lines not on this page · raw message

#2 lore raw

RFC PATCH 3/3 Add 'nfsref' command

In reply to Chuck Lever

The 'nfsref' command administers junctions. On an NFS server, it can create new junctions, remove existing junctions, or display the contents of junctions.

A man page with more details is included.

---
 configure.ac             |    1 
 utils/Makefile.am        |    4 +
 utils/nfsref/Makefile.am |   39 +++++++
 utils/nfsref/add.c       |  271 ++++++++++++++++++++++++++++++++++++++++++++++
 utils/nfsref/lookup.c    |  211 ++++++++++++++++++++++++++++++++++++
 utils/nfsref/nfsref.c    |  188 ++++++++++++++++++++++++++++++++
 utils/nfsref/nfsref.h    |   47 ++++++++
 utils/nfsref/nfsref.man  |  180 +++++++++++++++++++++++++++++++
 utils/nfsref/remove.c    |  145 +++++++++++++++++++++++++
 9 files changed, 1086 insertions(+)
 create mode 100644 utils/nfsref/Makefile.am
 create mode 100644 utils/nfsref/add.c
 create mode 100644 utils/nfsref/lookup.c
 create mode 100644 utils/nfsref/nfsref.c
 create mode 100644 utils/nfsref/nfsref.h
 create mode 100644 utils/nfsref/nfsref.man
 create mode 100644 utils/nfsref/remove.c
configure.ac +1 -0
index 8e7f036..59199f9 100644
@@ -604,6 +604,7 @@ AC_CONFIG_FILES([
 	utils/mount/Makefile
 	utils/mountd/Makefile
 	utils/nfsd/Makefile
+	utils/nfsref/Makefile
 	utils/nfsstat/Makefile
 	utils/nfsidmap/Makefile
 	utils/showmount/Makefile
utils/Makefile.am +4 -0
index c75a5a0..d361aea 100644
@@ -23,6 +23,10 @@ if CONFIG_NFSDCLTRACK
 OPTDIRS += nfsdcltrack
 endif
 
+if CONFIG_JUNCTION
+OPTDIRS += nfsref
+endif
+
 SUBDIRS = \
 	exportfs \
 	mountd \
utils/nfsref/Makefile.am new file +39 -0
new file mode 100644
index 0000000..2b2bb53
@@ -0,0 +1,39 @@
+##
+## @file utils/nfsref/Makefile.am
+## @brief Process this file with automake to produce utils/nfsref/Makefile.in
+##
+
+##
+## Copyright 2011, 2018 Oracle.  All rights reserved.
+##
+## This file is part of nfs-utils.
+##
+## nfs-utils is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License version 2.0 as
+## published by the Free Software Foundation.
+##
+## nfs-utils is distributed in the hope that it will be useful, but
+## WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License version 2.0 for more details.
+##
+## You should have received a copy of the GNU General Public License
+## version 2.0 along with nfs-utils.  If not, see:
+##
+##	http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
+##
+
+noinst_HEADERS		= nfsref.h
+
+sbin_PROGRAMS		= nfsref
+nfsref_SOURCES		= add.c lookup.c nfsref.c remove.c
+LDADD			= $(LIBXML2) $(LIBCAP) \
+			  ../../support/nfs/libnfs.la \
+			  ../../support/junction/libjunction.la
+
+man8_MANS		= nfsref.man
+
+MAINTAINERCLEANFILES	= Makefile.in
+
+AM_CPPFLAGS		= -I. -I../../support/include
+##AM_LDFLAGS		= -Wl,--as-needed
utils/nfsref/add.c new file +271 -0

271 lines not on this page · raw message

utils/nfsref/lookup.c new file +211 -0

211 lines not on this page · raw message

utils/nfsref/nfsref.c new file +188 -0

188 lines not on this page · raw message

utils/nfsref/nfsref.h new file +47 -0

47 lines not on this page · raw message

utils/nfsref/nfsref.man new file +180 -0

180 lines not on this page · raw message

utils/nfsref/remove.c new file +145 -0

145 lines not on this page · raw message

#3 lore raw
In reply to Chuck Lever

Thanks for doing this! I may not get the chance to do a real review, but I'm in favor of the basic idea.

--b.

Quoted 90 lines · Chuck Lever

THIS IS AN UNTESTED RFC SERIES. I'm posting this for review only.

A while back I announced the deprecation of fedfs-utils. There were a handful of components in fedfs-utils that we decided to keep. One of those keepers was the "nfsref" command. (The other was autofs support for /nfs4, which I hope Ian Kent is making progress on ;-)

This is an RFC patch series to introduce "nfsref" to nfs-utils, minus the overhead of the LDAP / FedFS machinery. It also adds a version of libnfsjunct which mountd can dynamically load to handle non-FedFS junctions, replacing the same part from fedfs-utils.

I didn't apply a lot of brain cells to this port, so it's perhaps a little larger than it needs to be. Still, it achieves a completely LDAP-free implementation. I'm interested in comments about the approach before I do more testing and refinement.

  ./configure --enable-junction --enable-caps

is needed before building.

Perhaps one thing that can be done is simply getting rid of the DLL and building junction support into mountd. I'm not sure if a transition period is necessary where the DLL is retained for a bit until fedfs-utils is entirely gone. Does anything but mountd use libnfsjunct ?

---

Chuck Lever (3):
Add LDAP-free version of libjunction to nfs-utils Add LDAP-free version of libnfsjunct to nfs-utils Add 'nfsref' command

 aclocal/libxml2.m4                   |   15 
 configure.ac                         |   12 
 support/Makefile.am                  |    4 
 support/include/Makefile.am          |    3 
 support/include/fedfs_admin.h        |  342 +++++++
 support/include/junction.h           |  124 +++
 support/include/nfs-plugin.h         |  101 ++
 support/junction/Makefile.am         |   40 +
 support/junction/display.c           |  159 +++
 support/junction/export-cache.c      |  118 +++
 support/junction/junction-internal.h |  121 +++
 support/junction/junction.c          |  494 +++++++++++
 support/junction/locations.c         |  131 +++
 support/junction/nfs-plugin.c        |  350 ++++++++
 support/junction/nfs.c               | 1564 ++++++++++++++++++++++++++++++++++
 support/junction/path.c              |  345 ++++++++
 support/junction/xml.c               |  401 +++++++++
 utils/Makefile.am                    |    4 
 utils/nfsref/Makefile.am             |   39 +
 utils/nfsref/add.c                   |  271 ++++++
 utils/nfsref/lookup.c                |  211 +++++
 utils/nfsref/nfsref.c                |  188 ++++
 utils/nfsref/nfsref.h                |   47 +
 utils/nfsref/nfsref.man              |  180 ++++
 utils/nfsref/remove.c                |  145 +++
 25 files changed, 5409 insertions(+)
 create mode 100644 aclocal/libxml2.m4
 create mode 100644 support/include/fedfs_admin.h
 create mode 100644 support/include/junction.h
 create mode 100644 support/include/nfs-plugin.h
 create mode 100644 support/junction/Makefile.am
 create mode 100644 support/junction/display.c
 create mode 100644 support/junction/export-cache.c
 create mode 100644 support/junction/junction-internal.h
 create mode 100644 support/junction/junction.c
 create mode 100644 support/junction/locations.c
 create mode 100644 support/junction/nfs-plugin.c
 create mode 100644 support/junction/nfs.c
 create mode 100644 support/junction/path.c
 create mode 100644 support/junction/xml.c
 create mode 100644 utils/nfsref/Makefile.am
 create mode 100644 utils/nfsref/add.c
 create mode 100644 utils/nfsref/lookup.c
 create mode 100644 utils/nfsref/nfsref.c
 create mode 100644 utils/nfsref/nfsref.h
 create mode 100644 utils/nfsref/nfsref.man
 create mode 100644 utils/nfsref/remove.c

--
Chuck Lever
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#4 lore raw
Quoted 6 lines · On Jan 9, 2018, at 2:21 PM, [email protected] wrote:

=20
Thanks for doing this! I may not get the chance to do a real review, but I'm in favor of the basic idea.

How do you feel about building support for junctions into mountd, and getting rid of the libnfsjunct DLL ?

Quoted 54 lines

--b.
=20

Quoted 51 lines · Chuck Lever

THIS IS AN UNTESTED RFC SERIES. I'm posting this for review only. =20
A while back I announced the deprecation of fedfs-utils. There were a handful of components in fedfs-utils that we decided to keep. One of those keepers was the "nfsref" command. (The other was autofs support for /nfs4, which I hope Ian Kent is making progress on ;-) =20
This is an RFC patch series to introduce "nfsref" to nfs-utils, minus the overhead of the LDAP / FedFS machinery. It also adds a version of libnfsjunct which mountd can dynamically load to handle non-FedFS junctions, replacing the same part from fedfs-utils. =20
I didn't apply a lot of brain cells to this port, so it's perhaps a little larger than it needs to be. Still, it achieves a completely LDAP-free implementation. I'm interested in comments about the approach before I do more testing and refinement.
=20
./configure --enable-junction --enable-caps
=20
is needed before building.
=20
Perhaps one thing that can be done is simply getting rid of the DLL and building junction support into mountd. I'm not sure if a transition period is necessary where the DLL is retained for a bit until fedfs-utils is entirely gone. Does anything but mountd use libnfsjunct ?
=20
=20
---
=20
Chuck Lever (3):
Add LDAP-free version of libjunction to nfs-utils Add LDAP-free version of libnfsjunct to nfs-utils Add 'nfsref' command
=20
=20

aclocal/libxml2.m4                   |   15=20
configure.ac                         |   12=20
support/Makefile.am                  |    4=20
support/include/Makefile.am          |    3=20
support/include/fedfs_admin.h        |  342 +++++++
support/include/junction.h           |  124 +++
support/include/nfs-plugin.h         |  101 ++
support/junction/Makefile.am         |   40 +
support/junction/display.c           |  159 +++
support/junction/export-cache.c      |  118 +++
support/junction/junction-internal.h |  121 +++
support/junction/junction.c          |  494 +++++++++++
support/junction/locations.c         |  131 +++
support/junction/nfs-plugin.c        |  350 ++++++++
support/junction/nfs.c               | 1564 =

++++++++++++++++++++++++++++++++++

Quoted 29 lines
Quoted 29 lines
support/junction/path.c              |  345 ++++++++
support/junction/xml.c               |  401 +++++++++
utils/Makefile.am                    |    4=20
utils/nfsref/Makefile.am             |   39 +
utils/nfsref/add.c                   |  271 ++++++
utils/nfsref/lookup.c                |  211 +++++
utils/nfsref/nfsref.c                |  188 ++++
utils/nfsref/nfsref.h                |   47 +
utils/nfsref/nfsref.man              |  180 ++++
utils/nfsref/remove.c                |  145 +++
25 files changed, 5409 insertions(+)

create mode 100644 aclocal/libxml2.m4
create mode 100644 support/include/fedfs_admin.h create mode 100644 support/include/junction.h create mode 100644 support/include/nfs-plugin.h create mode 100644 support/junction/Makefile.am create mode 100644 support/junction/display.c create mode 100644 support/junction/export-cache.c create mode 100644 support/junction/junction-internal.h create mode 100644 support/junction/junction.c create mode 100644 support/junction/locations.c create mode 100644 support/junction/nfs-plugin.c create mode 100644 support/junction/nfs.c create mode 100644 support/junction/path.c create mode 100644 support/junction/xml.c create mode 100644 utils/nfsref/Makefile.am create mode 100644 utils/nfsref/add.c
create mode 100644 utils/nfsref/lookup.c create mode 100644 utils/nfsref/nfsref.c

Quoted 8 lines
Quoted 8 lines

create mode 100644 utils/nfsref/nfsref.h
create mode 100644 utils/nfsref/nfsref.man
create mode 100644 utils/nfsref/remove.c
=20
--
Chuck Lever
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" =

in

Quoted 2 lines
Quoted 2 lines

the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

--
Chuck Lever

#5 lore raw
Quoted 9 lines · Chuck Lever
Quoted 6 lines · On Jan 9, 2018, at 2:21 PM, [email protected] wrote:

Thanks for doing this! I may not get the chance to do a real review, but I'm in favor of the basic idea.

How do you feel about building support for junctions into mountd, and getting rid of the libnfsjunct DLL ?

I would rather not put new functionality in daemons that needs rpcbind. With the idea of, someday, having clean v4-only configuration (aka no mountd, statd, or lockd).

Quoted 21 lines
Quoted 21 lines · Chuck Lever
Quoted 19 lines

THIS IS AN UNTESTED RFC SERIES. I'm posting this for review only.

A while back I announced the deprecation of fedfs-utils. There were a handful of components in fedfs-utils that we decided to keep. One of those keepers was the "nfsref" command. (The other was autofs support for /nfs4, which I hope Ian Kent is making progress on ;-)

This is an RFC patch series to introduce "nfsref" to nfs-utils, minus the overhead of the LDAP / FedFS machinery. It also adds a version of libnfsjunct which mountd can dynamically load to handle non-FedFS junctions, replacing the same part from fedfs-utils.

I didn't apply a lot of brain cells to this port, so it's perhaps a little larger than it needs to be. Still, it achieves a completely LDAP-free implementation. I'm interested in comments about the approach before I do more testing and refinement.

./configure --enable-junction --enable-caps

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

is needed before building.

Perhaps one thing that can be done is simply getting rid of the DLL and building junction support into mountd. I'm not sure if a transition period is necessary where the DLL is retained for a bit until fedfs-utils is entirely gone. Does anything but mountd use libnfsjunct ?

So nfsref is to manage NFS referrals... got it... which I think is a good thing to put into nfs-utils.. but again I wold like to move a way from using mountd for exporting stuff.

I must admit my memory on how referrals work is a bet strained, but does it make any sense at all to move the referral code out of mountd and into a new command maybe called nfsexport. Then have the kernel call up to that command (similar to how it does with nfsidmap) to get the referrals info. That way only nfsexport would link with libnfsjunct.

Now I realize this has nothing to do with putting nfsref into nfs-utils... I'm all for that... and I'm not asking you to do the work... I'm thinking out loud... Does it make sense to use this opportunity to build new mechanisms to handle referrals and then possibly all exports?? Again, with the idea of eliminating need for legacy daemons.

steved.

#6 lore raw
Quoted 7 lines · Steve Dickson
Quoted 4 lines · Chuck Lever
Quoted 4 lines · On Jan 9, 2018, at 2:21 PM, [email protected] wrote:
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

Thanks for doing this! I may not get the chance to do a real review, but I'm in favor of the basic idea.

How do you feel about building support for junctions into mountd, and getting rid of the libnfsjunct DLL ?

I would rather not put new functionality in daemons that needs rpcbind. With the idea of, someday, having clean v4-only configuration (aka no mountd, statd, or lockd).

rpc.mountd is used by v4 for a lot of stuff already, so it's not going away. Is it trying to register with rpcbind in the case it's called with -N2 -N3? That would be a bug.

--b.

#7 lore raw
Quoted 11 lines · Bruce Fields
Quoted 10 lines · Steve Dickson
Quoted 7 lines · Chuck Lever
Quoted 6 lines · On Jan 9, 2018, at 2:21 PM, [email protected] wrote:

Thanks for doing this! I may not get the chance to do a real review, but I'm in favor of the basic idea.

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

How do you feel about building support for junctions into mountd, and getting rid of the libnfsjunct DLL ?

I would rather not put new functionality in daemons that needs rpcbind. With the idea of, someday, having clean v4-only configuration (aka no mountd, statd, or lockd).

rpc.mountd is used by v4 for a lot of stuff already, so it's not going away.

Understood.... I guess I'm looking for a way to replace it with a command the kernel can call to only do v4 stuff. Would something like that make sense?

Quoted 2 lines

Is it trying to register with rpcbind in the case it's called with -N2 -N3? That would be a bug.

Looking at the code... probably not...

steved.

Quoted 3 lines

--b.

#8 lore raw
Quoted 20 lines · Steve Dickson
Quoted 17 lines · Bruce Fields
Quoted 15 lines · Steve Dickson
Quoted 9 lines · Chuck Lever
Quoted 6 lines · On Jan 9, 2018, at 2:21 PM, [email protected] wrote:

Thanks for doing this! I may not get the chance to do a real review, but I'm in favor of the basic idea.

How do you feel about building support for junctions into mountd, and getting rid of the libnfsjunct DLL ?

I would rather not put new functionality in daemons that needs rpcbind. With the idea of, someday, having clean v4-only configuration (aka no mountd, statd, or lockd).

Quoted 5 lines
Quoted 2 lines

rpc.mountd is used by v4 for a lot of stuff already, so it's not going away.

Understood.... I guess I'm looking for a way to replace it with a command the kernel can call to only do v4 stuff. Would something like that make sense?

It would be a fair amount of work and I don't think there's a strong reason to do it.

rpc.mountd -N2 -N3 should do what we want.

--b.

Quoted 9 lines
Quoted 3 lines

Is it trying to register with rpcbind in the case it's called with -N2 -N3? That would be a bug.

Looking at the code... probably not...

steved.

Quoted 3 lines

--b.

#9 lore raw
In reply to Steve Dickson
Quoted 11 lines · Steve Dickson
Quoted 4 lines · Chuck Lever
Quoted 4 lines · On Jan 9, 2018, at 2:21 PM, [email protected] wrote:
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

Thanks for doing this! I may not get the chance to do a real review, but I'm in favor of the basic idea.

How do you feel about building support for junctions into mountd, and getting rid of the libnfsjunct DLL ?

I would rather not put new functionality in daemons that needs rpcbind. With the idea of, someday, having clean v4-only configuration (aka no mountd, statd, or lockd).

Hi Steve, junction support is not new functionality.

Currently, mountd handles junction support by loading a DLL called libnfsjunct. We did this because you didn't want to add an LDAP dependency to nfs-utils in order to support FedFS.

What I'm proposing is that because we no longer need LDAP support, we could build support for NFS basic junctions directly into mountd. This would be straightforward: just put nfs-plugin.c under utils/mountd and link it in at build time. Then dump the logic to load a plug-in (or we could even conditionally compile it in or out).

The NFS basic junction code is already being ported into nfs-utils to support the nfsref command.

The long-term implication is that this removes the pluggable API for supporting other types of junctions, like reparse points should Linux ever choose to implement them. Since Linux doesn't have these now, and it's not a standard API anyway, maybe this is moot and I should go ahead and rip out the plug-in logic.

Quoted 31 lines
Quoted 20 lines
Quoted 20 lines · Chuck Lever
Quoted 19 lines

THIS IS AN UNTESTED RFC SERIES. I'm posting this for review only.

A while back I announced the deprecation of fedfs-utils. There were a handful of components in fedfs-utils that we decided to keep. One of those keepers was the "nfsref" command. (The other was autofs support for /nfs4, which I hope Ian Kent is making progress on ;-)

This is an RFC patch series to introduce "nfsref" to nfs-utils, minus the overhead of the LDAP / FedFS machinery. It also adds a version of libnfsjunct which mountd can dynamically load to handle non-FedFS junctions, replacing the same part from fedfs-utils.

I didn't apply a lot of brain cells to this port, so it's perhaps a little larger than it needs to be. Still, it achieves a completely LDAP-free implementation. I'm interested in comments about the approach before I do more testing and refinement.

./configure --enable-junction --enable-caps

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

is needed before building.

Perhaps one thing that can be done is simply getting rid of the DLL and building junction support into mountd. I'm not sure if a transition period is necessary where the DLL is retained for a bit until fedfs-utils is entirely gone. Does anything but mountd use libnfsjunct ?

So nfsref is to manage NFS referrals... got it... which I think is a good thing to put into nfs-utils.. but again I wold like to move a way from using mountd for exporting stuff.

Quoted 6 lines

I must admit my memory on how referrals work is a bet strained, but does it make any sense at all to move the referral code out of mountd and into a new command maybe called nfsexport. Then have the kernel call up to that command (similar to how it does with nfsidmap) to get the referrals info. That way only nfsexport would link with libnfsjunct.

Since FedFS support is no longer needed, junction support could also be built directly into nfsexport (no separate DLL is necessary).

Quoted 6 lines

Now I realize this has nothing to do with putting nfsref into nfs-utils... I'm all for that... and I'm not asking you to do the work... I'm thinking out loud... Does it make sense to use this opportunity to build new mechanisms to handle referrals and then possibly all exports?? Again, with the idea of eliminating need for legacy daemons.

I don't have any quarrel with carving out the non-network-exposed functionality of mountd and putting it in an upcall similar to nfsidmap. Seems like an entirely separate project, though, and probably a significant chunk of work.

Given the heightened security consciousness in today's world, sandboxing the network-exposed part is a sensible precaution for deployments that continue to need a MNT RPC service.

In the long run, IMO the existing mountd upcall is going to have to be replaced. The current upcall mechanism is limited to moving just a page of data; fs_locations and fs_locations_info can comprise more than a page. And the upcall API might have to be revisited carefully to support fs_locations_info.

--
Chuck Lever

#10 lore raw
Quoted 20 lines · Chuck Lever
Quoted 11 lines · Steve Dickson
Quoted 4 lines · Chuck Lever
Quoted 4 lines · On Jan 9, 2018, at 2:21 PM, [email protected] wrote:
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

Thanks for doing this! I may not get the chance to do a real review, but I'm in favor of the basic idea.

How do you feel about building support for junctions into mountd, and getting rid of the libnfsjunct DLL ?

I would rather not put new functionality in daemons that needs rpcbind. With the idea of, someday, having clean v4-only configuration (aka no mountd, statd, or lockd).

Quoted 5 lines

Hi Steve, junction support is not new functionality.

Currently, mountd handles junction support by loading a DLL called libnfsjunct. We did this because you didn't want to add an LDAP dependency to nfs-utils in order to support FedFS.

Right.. I remember now...

Quoted 6 lines

What I'm proposing is that because we no longer need LDAP support, we could build support for NFS basic junctions directly into mountd. This would be straightforward: just put nfs-plugin.c under utils/mountd and link it in at build time. Then dump the logic to load a plug-in (or we could even conditionally compile it in or out).

I see... why would we do it conditionally? Are they ever coming back?

Quoted 9 lines

The NFS basic junction code is already being ported into nfs-utils to support the nfsref command.

The long-term implication is that this removes the pluggable API for supporting other types of junctions, like reparse points should Linux ever choose to implement them. Since Linux doesn't have these now, and it's not a standard API anyway, maybe this is moot and I should go ahead and rip out the plug-in logic.

I guess this answers my question above... They could come back if reparse points is supported.

Quoted 40 lines
Quoted 33 lines
Quoted 22 lines
Quoted 22 lines · Chuck Lever
Quoted 19 lines

THIS IS AN UNTESTED RFC SERIES. I'm posting this for review only.

A while back I announced the deprecation of fedfs-utils. There were a handful of components in fedfs-utils that we decided to keep. One of those keepers was the "nfsref" command. (The other was autofs support for /nfs4, which I hope Ian Kent is making progress on ;-)

This is an RFC patch series to introduce "nfsref" to nfs-utils, minus the overhead of the LDAP / FedFS machinery. It also adds a version of libnfsjunct which mountd can dynamically load to handle non-FedFS junctions, replacing the same part from fedfs-utils.

I didn't apply a lot of brain cells to this port, so it's perhaps a little larger than it needs to be. Still, it achieves a completely LDAP-free implementation. I'm interested in comments about the approach before I do more testing and refinement.

./configure --enable-junction --enable-caps

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

is needed before building.

Perhaps one thing that can be done is simply getting rid of the DLL and building junction support into mountd. I'm not sure if a transition period is necessary where the DLL is retained for a bit until fedfs-utils is entirely gone. Does anything but mountd use libnfsjunct ?

So nfsref is to manage NFS referrals... got it... which I think is a good thing to put into nfs-utils.. but again I wold like to move a way from using mountd for exporting stuff.

Quoted 6 lines

I must admit my memory on how referrals work is a bet strained, but does it make any sense at all to move the referral code out of mountd and into a new command maybe called nfsexport. Then have the kernel call up to that command (similar to how it does with nfsidmap) to get the referrals info. That way only nfsexport would link with libnfsjunct.

Quoted 3 lines

Since FedFS support is no longer needed, junction support could also be built directly into nfsexport (no separate DLL is necessary).

Got it... but a v4only exporter did seem to impress anybody ;-)

Quoted 9 lines
Quoted 8 lines

Now I realize this has nothing to do with putting nfsref into nfs-utils... I'm all for that... and I'm not asking you to do the work... I'm thinking out loud... Does it make sense to use this opportunity to build new mechanisms to handle referrals and then possibly all exports?? Again, with the idea of eliminating need for legacy daemons.

Quoted 4 lines

I don't have any quarrel with carving out the non-network-exposed functionality of mountd and putting it in an upcall similar to nfsidmap. Seems like an entirely separate project, though, and probably a significant chunk of work.

It is... I was just floating the idea.

Quoted 10 lines

Given the heightened security consciousness in today's world, sandboxing the network-exposed part is a sensible precaution for deployments that continue to need a MNT RPC service.

In the long run, IMO the existing mountd upcall is going to have to be replaced. The current upcall mechanism is limited to moving just a page of data; fs_locations and fs_locations_info can comprise more than a page. And the upcall API might have to be revisited carefully to support fs_locations_info.

nfsimdap uses keyrings to communicate with the kernel. Maybe that could be used to replace the kernel upcalls?

steved.

#11 lore raw
Quoted 6 lines · Steve Dickson
Quoted 4 lines · Chuck Lever

I don't have any quarrel with carving out the non-network-exposed functionality of mountd and putting it in an upcall similar to nfsidmap. Seems like an entirely separate project, though, and probably a significant chunk of work.

It is... I was just floating the idea.

Yeah, I don't mean to veto the idea, I think we've discussed it before and it's kind of appealing. I just think we haven't thought it through and we don't have any real reason it's necessary right now. I'd hate to send someone down that rabbit hole and have the come back with a bunch of work and us say "uh, but why do we want this?".

--b.