Skip to contentSkip to conversation

FedFS file system client support

PATCH In review Chuck Lever 2 participants 5 messages May 26, 2011 – Jun 1, 2011 Kernel automounter

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 FedFS file system client support

Hi-

The next release of fedfs-utils will provide all necessary components for a Linux NFS client to participate in a FedFS domain as a file system client. This new utility is intended to be a part of the upcoming release.

I'm interested in comments on this approach. Ian had suggested a new lookup module, but a program map looked simpler to prototype and has the great advantage of no dependencies between fedfs-utils and autofs. If program maps have some nasty problem that require the use of a lookup module, we can take that next step.

---

Chuck Lever (1):
mount: Add automounter program map for FedFS

 .gitignore                 |    1 
 INSTALL                    |   10 +-
 README                     |   14 ++-
 doc/man/Makefile.am        |    2 
 doc/man/fedfs-map-nfs4.8   |  154 ++++++++++++++++++++++++++++
 doc/man/fedfs.7            |    4 +
 src/mount/Makefile.am      |    5 +
 src/mount/fedfs-map-nfs4.c |  242 ++++++++++++++++++++++++++++++++++++++++++++
 8 files changed, 422 insertions(+), 10 deletions(-)
 create mode 100644 doc/man/fedfs-map-nfs4.8
 create mode 100644 src/mount/fedfs-map-nfs4.c
Signature · 1 line
Chuck Lever
#1 lore raw

PATCH 1/1 mount: Add automounter program map for FedFS

This new utility interprets the passed-in key as a FedFS domain, performs a DNS SRV lookup, and generates the mount.nfs parameters needed to mount the domain. It can handle multiple read-only and read-write domain root replicas using support already built into the automounter.

The FedFS entry in the master map might look like this:

/nfs4 /usr/sbin/fedfs-map-nfs4

To support other file system protocols, additional lines in the master map and another program map utility (or options for this one) would be needed.

Benefits:

o Simple to configure

o The TLD can be placed anywhere on the client

o No additional build or package dependencies on nfs-utils or autofs

---

 .gitignore                 |    1 
 INSTALL                    |   10 +-
 README                     |   14 ++-
 doc/man/Makefile.am        |    2 
 doc/man/fedfs-map-nfs4.8   |  154 ++++++++++++++++++++++++++++
 doc/man/fedfs.7            |    4 +
 src/mount/Makefile.am      |    5 +
 src/mount/fedfs-map-nfs4.c |  242 ++++++++++++++++++++++++++++++++++++++++++++
 8 files changed, 422 insertions(+), 10 deletions(-)
 create mode 100644 doc/man/fedfs-map-nfs4.8
 create mode 100644 src/mount/fedfs-map-nfs4.c
.gitignore +1 -0
index ce06ff1..41daf0f 100644
@@ -9,6 +9,7 @@ src/fedfsd/fedfsd
 src/resolve-junction/resolve-junction
 src/nsdbparams/nsdbparams
 src/mount/mount.fedfs
+src/mount/fedfs-map-nfs4
 libadmin.a
 libjunction.a
 libnsdb.a
INSTALL +6 -4
index 8cb8e9e..548381b 100644
@@ -143,12 +143,14 @@ FedFS file server
 
 FedFS client
 
-  o Install mount.fedfs
+  o Install /usr/sbin/fedfs-map-nfs4
 
-  o Create a local /nfs4 directory, and subdirectories for the FedFS
-    domains you want to mount
+  o Create a local /nfs4 directory
 
-  o Add lines to /etc/fstab to mount the domains
+  o Install and configure autofs
+
+  o Add an entry to the master map (usually /etc/auto.master) for
+    the /nfs4 directory and restart autofs
 
 
 FedFS admin client
README +11 -3
index 0067ac2..78b9647 100644
@@ -59,7 +59,10 @@ changed over time.
 
 Installable components include:
 
-   o  A mount command to mount the top of a FedFS domain namespace
+   o  An automounter program map to manage the FedFS domain namespace
+      on FedFS-enabled clients
+
+   o  A mount command to mount parts of a FedFS domain namespace
 
    o  An ONC RPC service daemon that runs on file servers enabling the
       management by remote FedFS ADMIN clients of FedFS junctions
@@ -81,9 +84,14 @@ Installable components include:
    o  HTML Doxygen style documentation with built-in source browser
 
 
+The automounter program map is a subcommand invoked by the automounter
+to locate FedFS domains and construct appropriate mount options for
+mounting domain roots.  It is used in conjunction with the Linux
+autofs facility.
+
 The mount command is a subcommand invoked by mount(8) to handle the
-housekeeping needed to find and mount FedFS domains at the top of the
-client's FedFS namespace (usually /nfs4 for NFSv4 servers).
+housekeeping needed to find and mount part or all of FedFS domain
+name spaces.
 
 The fedfsd program is an RPC server that allows remote administrators to
 create FedFS junctions in local file systems.  FedFS ADMIN requests that
doc/man/Makefile.am +1 -1
index 7f92ebf..83c6d03 100644
@@ -24,6 +24,6 @@
 ##
 
 dist_man7_MANS		= fedfs.7
-dist_man8_MANS		= rpc.fedfsd.8 mount.fedfs.8
+dist_man8_MANS		= rpc.fedfsd.8 mount.fedfs.8 fedfs-map-nfs4.8
 CLEANFILES		= cscope.in.out cscope.out cscope.po.out
 DISTCLEANFILES		= Makefile.in
doc/man/fedfs-map-nfs4.8 new file +154 -0

154 lines not on this page · raw message

doc/man/fedfs.7 +3 -1
index a2d2759..83eb215 100644
@@ -164,7 +164,8 @@ file system below them,
 are visible at a different point in a client's name space
 than are read-only replicas.
 .SS Globally Useful Names
-On FedFS-enabled Linux clients, the
+On FedFS-enabled Linux clients,
+either the automounter, with a special program map, or the
 .BR mount.fedfs (8)
 command finds and mounts the root of a FedFS domain.
 .P
@@ -258,6 +259,7 @@ when administering junctions and filesets,
 junctions are created on file servers and
 registered with the domain's NSDB in two separate steps.
 .SH SEE ALSO
+.BR fedfs-map-nfs4 (8),
 .BR mount.fedfs (8),
 .BR rpc.fedfsd (8),
 .BR rpc.mountd (8),
src/mount/Makefile.am +4 -1
index 9338d47..93c6b72 100644
@@ -24,7 +24,10 @@
 ##
 
 noinst_HEADERS		= nls.h
-sbin_PROGRAMS		= mount.fedfs
+sbin_PROGRAMS		= mount.fedfs fedfs-map-nfs4
+fedfs_map_nfs4_SOURCES	= fedfs-map-nfs4.c
+fedfs_map_nfs4_LDADD	= -lresolv \
+			  $(top_builddir)/src/libsi/libsi.a
 mount_fedfs_SOURCES	= main.c
 mount_fedfs_LDADD	= -lresolv \
 			  $(top_builddir)/src/libsi/libsi.a
src/mount/fedfs-map-nfs4.c new file +242 -0

242 lines not on this page · raw message

maintainer
#2 lore raw
In reply to Chuck Lever
Quoted 7 lines · Chuck Lever

Hi-

The next release of fedfs-utils will provide all necessary components for a Linux NFS client to participate in a FedFS domain as a file system client. This new utility is intended to be a part of the upcoming release.

Quoted 5 lines

I'm interested in comments on this approach. Ian had suggested a new lookup module, but a program map looked simpler to prototype and has the great advantage of no dependencies between fedfs-utils and autofs. If program maps have some nasty problem that require the use of a lookup module, we can take that next step.

The only difficulty with using a program map is that to use it you need to know the name of the of the <key> (aka. /nfs4/<key>) since, at the moment, autofs can't enumerate program map keys.

Ian

#3 lore raw
Quoted 14 lines · Ian Kent
Quoted 7 lines · Chuck Lever

Hi-

The next release of fedfs-utils will provide all necessary components for a Linux NFS client to participate in a FedFS domain as a file system client. This new utility is intended to be a part of the upcoming release.

Quoted 5 lines

I'm interested in comments on this approach. Ian had suggested a new lookup module, but a program map looked simpler to prototype and has the great advantage of no dependencies between fedfs-utils and autofs. If program maps have some nasty problem that require the use of a lookup module, we can take that next step.

Quoted 3 lines

The only difficulty with using a program map is that to use it you need to know the name of the of the <key> (aka. /nfs4/<key>) since, at the moment, autofs can't enumerate program map keys.

If I understand your comment correctly, the problem is how the client discovers FedFS domain names to use as keys.

As I understand it, FedFS does not currently have a mechanism for clients to discover FedFS domain names, like, say, AFS did with CellServDB.

Also, FedFS file system clients don't belong to a particular domain, so they don't have any idea what might be their "local" domain. Any client can access any domain; security is provided by the underlying file system protocols. The domains are just a way to organize the name spaces, without any regard to security administrative domains.

Thus, right now users and applications have to know a priori the whole pathname (or, Globally Useful Name, in FedFS parlance) in order to access a file resource via FedFS.

Are you suggesting there is a better design we could adopt that might prepare FedFS for a time when there is a mechanism for discovering FedFS domain names?

Signature · 2 lines
Chuck Lever
chuck[dot]lever[at]oracle[dot]com
maintainer
#4 lore raw
Quoted 33 lines · Chuck Lever
Quoted 14 lines · Ian Kent
Quoted 7 lines · Chuck Lever

Hi-

The next release of fedfs-utils will provide all necessary components for a Linux NFS client to participate in a FedFS domain as a file system client. This new utility is intended to be a part of the upcoming release.

Quoted 5 lines

I'm interested in comments on this approach. Ian had suggested a new lookup module, but a program map looked simpler to prototype and has the great advantage of no dependencies between fedfs-utils and autofs. If program maps have some nasty problem that require the use of a lookup module, we can take that next step.

Quoted 3 lines

The only difficulty with using a program map is that to use it you need to know the name of the of the <key> (aka. /nfs4/<key>) since, at the moment, autofs can't enumerate program map keys.

If I understand your comment correctly, the problem is how the client discovers FedFS domain names to use as keys.

As I understand it, FedFS does not currently have a mechanism for clients to discover FedFS domain names, like, say, AFS did with CellServDB.

Also, FedFS file system clients don't belong to a particular domain, so they don't have any idea what might be their "local" domain. Any client can access any domain; security is provided by the underlying file system protocols. The domains are just a way to organize the name spaces, without any regard to security administrative domains.

Quoted 7 lines

Thus, right now users and applications have to know a priori the whole pathname (or, Globally Useful Name, in FedFS parlance) in order to access a file resource via FedFS.

Are you suggesting there is a better design we could adopt that might prepare FedFS for a time when there is a mechanism for discovering FedFS domain names?

Only in so much as, to do this we would need to use a lookup module or add autofs support for program maps to enumerate their keys and that only makes sense if there is a way to enumerate domains, perhaps by pre-configuring names.

Adding the ability for program maps to enumerate their keys has been discussed before. Although it hasn't been done yet, using a NULL key to ask the program for a list of its known keys should be straight forward. Of course that assumes that the FedFS program map will allow the use of a local list of domains to prime its cache and that autofs will function ok for exiting and not yet existing keys (it should, if not I need to fix it). The other catch is that we don't know if others using program maps handle the case of a NULL key since they don't get them now. From memory, a SEGV in a program map doesn't kill autofs and the request just fails, as it should, but I'd need to check that.

To allow the use of external lookup modules I would need to formalize and document the lookup module interface and provide a means to configure a path to look in for modules or a way to specify an explicit path to an external lookup module.

I think that will require a fair amount of change to separate the internal autofs bits for modules from the internals independent bits. I've been thinking about that for another request. I'm still not sure about it since we have had some difficult problems relating to the order of module dependent shared libraries being closed (or being released anyway) and this likely would open that can of worms.

Mmm ...