Skip to contentSkip to conversation

NFS basic junction support for nfs-utils

PATCH Superseded Chuck Lever 1 participant 4 messages Jan 28, 2018

Subsystems (2)

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

v3 cover NFS basic junction support for nfs-utils

Still UNTESTED.

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 series introduces "nfsref" to nfs-utils, minus the overhead of the LDAP / FedFS machinery, and it builds support for NFS basic junctions into mountd, replacing the need to install a plug-in DLL 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 that resides 100% in nfs-utils. I'm interested in comments about the approach before I do more testing and refinement.

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

is needed before building.

Changes since v2:
None.

Changes since RFC (v1):
Patch 2/3 in the original series added the libnfsjunct.so DLL to nfs-utils. Series v2 instead replaces 2/3 with a patch that puts support for junctions into mountd without the need for a DLL.

---

Chuck Lever (3):
Add LDAP-free version of libjunction to nfs-utils
mountd: Solder in support for NFS basic junctions Add LDAP-free 'nfsref' command

 aclocal/libxml2.m4                   |   15 
 configure.ac                         |   17 
 support/Makefile.am                  |    4 
 support/include/Makefile.am          |    2 
 support/include/fedfs_admin.h        |  342 +++++++
 support/include/junction.h           |  124 +++
 support/junction/Makefile.am         |   34 +
 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.c               | 1564 ++++++++++++++++++++++++++++++++++
 support/junction/path.c              |  345 ++++++++
 support/junction/xml.c               |  401 +++++++++
 utils/Makefile.am                    |    4 
 utils/mountd/Makefile.am             |    8 
 utils/mountd/cache.c                 |  189 ++--
 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, 5049 insertions(+), 104 deletions(-)
 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/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.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

PATCH v3 2/3 mountd: Solder in support for NFS basic junctions

This patch does two things:

1. Reverts ab74900ff59e ("mountd: Support junction management plug-ins")

2. Re-implements support for NFS basic junctions directly in mountd

So no more support for FedFS junctions, and no more need to have a dynamically load component installed from another package.

The downside is that mountd has to be linked with libxml2 to get this support. Thus to make the use of libxml2 optional, built-in support for junctions is enabled only when --enable-junction is specified on the command line.

---
 configure.ac             |    5 -
 utils/mountd/Makefile.am |    8 ++
 utils/mountd/cache.c     |  189 ++++++++++++++++++++++------------------------
 3 files changed, 98 insertions(+), 104 deletions(-)
configure.ac +1 -4
index 8e7f036..d2e48a5 100644
@@ -308,8 +308,6 @@ AC_CHECK_FUNC([getservbyname], ,
 
 AC_CHECK_LIB([crypt], [crypt], [LIBCRYPT="-lcrypt"])
 
-AC_CHECK_LIB([dl], [dlclose], [LIBDL="-ldl"])
-
 if test "$enable_nfsv4" = yes; then
   dnl check for libevent libraries and headers
   AC_LIBEVENT
@@ -372,7 +370,6 @@ AC_SUBST(LIBSOCKET)
 AC_SUBST(LIBCRYPT)
 AC_SUBST(LIBBSD)
 AC_SUBST(LIBBLKID)
-AC_SUBST(LIBDL)
 
 if test "$enable_libmount" = yes; then
    AC_CHECK_LIB(mount, mnt_context_do_mount, [LIBMOUNT="-lmount"], AC_MSG_ERROR([libmount needed]))
@@ -466,7 +463,7 @@ AC_CHECK_HEADERS([arpa/inet.h fcntl.h libintl.h limits.h \
                  stdlib.h string.h sys/file.h sys/ioctl.h sys/mount.h \
                  sys/param.h sys/socket.h sys/time.h sys/vfs.h \
                  syslog.h unistd.h com_err.h et/com_err.h \
-                 ifaddrs.h nfs-plugin.h libio.h])
+                 ifaddrs.h libio.h])
 
 dnl *************************************************************
 dnl Checks for typedefs, structures, and compiler characteristics
utils/mountd/Makefile.am +7 -1
index 153a90a..73eeb3f 100644
@@ -1,5 +1,10 @@
 ## Process this file with automake to produce Makefile.in
 
+OPTLIBS		=
+if CONFIG_JUNCTION
+OPTLIBS		+= ../../support/junction/libjunction.la $(LIBXML2)
+endif
+
 man8_MANS	= mountd.man
 EXTRA_DIST	= $(man8_MANS)
 
@@ -13,7 +18,8 @@ mountd_SOURCES = mountd.c mount_dispatch.c auth.c rmtab.c cache.c \
 mountd_LDADD = ../../support/export/libexport.a \
 	       ../../support/nfs/libnfs.la \
 	       ../../support/misc/libmisc.a \
-	       $(LIBBSD) $(LIBWRAP) $(LIBNSL) $(LIBBLKID) $(LIBDL) $(LIBTIRPC)
+	       $(OPTLIBS) \
+	       $(LIBBSD) $(LIBWRAP) $(LIBNSL) $(LIBBLKID) $(LIBTIRPC)
 mountd_CPPFLAGS = $(AM_CPPFLAGS) $(CPPFLAGS) \
 		  -I$(top_builddir)/support/include \
 		  -I$(top_srcdir)/support/export
utils/mountd/cache.c +90 -99

255 lines not on this page · raw message

#2 lore raw

PATCH v3 3/3 Add LDAP-free '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 d2e48a5..fba9064 100644
@@ -601,6 +601,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

Hi Steve-

I suspect 1/3 is being rejected by vger because it is too large. I will look for a way to break it up, and resend.

Quoted 1 line

On Jan 28, 2018, at 10:34 AM, Chuck Lever <[email protected]> =

Quoted 41 lines · wrote:

=20
Still UNTESTED.
=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 series introduces "nfsref" to nfs-utils, minus the overhead of the LDAP / FedFS machinery, and it builds support for NFS basic junctions into mountd, replacing the need to install a plug-in DLL 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 that resides 100% in nfs-utils. 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
=20
Changes since v2:
None.
=20
=20
Changes since RFC (v1):
Patch 2/3 in the original series added the libnfsjunct.so DLL to nfs-utils. Series v2 instead replaces 2/3 with a patch that puts support for junctions into mountd without the need for a DLL. =20
---
=20
Chuck Lever (3):
Add LDAP-free version of libjunction to nfs-utils
mountd: Solder in support for NFS basic junctions Add LDAP-free 'nfsref' command
=20
=20

Quoted 13 lines
aclocal/libxml2.m4                   |   15=20
configure.ac                         |   17=20
support/Makefile.am                  |    4=20
support/include/Makefile.am          |    2=20
support/include/fedfs_admin.h        |  342 +++++++
support/include/junction.h           |  124 +++
support/junction/Makefile.am         |   34 +
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.c               | 1564 =

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

Quoted 29 lines
support/junction/path.c              |  345 ++++++++
support/junction/xml.c               |  401 +++++++++
utils/Makefile.am                    |    4=20
utils/mountd/Makefile.am             |    8=20
utils/mountd/cache.c                 |  189 ++--
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, 5049 insertions(+), 104 deletions(-)

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/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.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

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

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

--
Chuck Lever