Project Requirements Specification

Mirror-mounts: NFSv4 client support for crossing server mountpoints



Calum Mackay

mm-PRD.html 1.8 07/04/12


Executive Summary

Mirror-mounts will enable an NFSv4 client to traverse shared filesystem mount points in the server namespace.

This enables a move away from arbitrary filesystem boundaries, towards a global namespace, and, eventually, to remove the requirement for the MOUNT protocol for v4-only mounts.

The main advantages over the traditional automounter-based approach are that namespace changes on the server are immediately visible to all clients, and there is no longer the overhead associated with administering automount maps.

As an example, consider the case where a system administrator is migrating from a single, large, UFS filesystem, to many small ZFS filesystems. With an existing automounter-based setup, the new ZFS shared filesystems will need to be individually listed in indirect automount maps. Depending on the type of naming service in use, and its update schedule, these changes might take a considerable amount of time to be seen by all clients.

In contrast, with mirror-mounts, the new shared filesystems will be discovered instantly, when the client accesses them, and automatically mounted.

NOTE: Mirror-mounts are an NFS client enhancement based upon the NFSv4 protocol (RFC3530), and do not form part of, nor have any dependency on, the proposed NFSv4 Minor Version 1.

Project Requirements

Triggering actions for automatic mirror-mount

Nested mirror-mounts

User visibility of mirror-mounted mount points

Automatic unmounting

Manual unmounting

Recursive manual hierarchical unmounting

Interaction with the automounter

Disabling mirror-mounts

Inheritance of mount properties

Security

Documentation

TBD - list man pages; mount_nfs(1M), ...

Out of scope / Future work

The following functionality will not be delivered by this project, but may be delivered by a future project.

Impact

This project has a fairly narrow impact on Solaris. It makes a regularly performed sysadmin task somewhat easier, by automating much of it, and presents an enhanced filesystem view to the client users.

System administrators may need to become familiar with the proposed sharectl(1M) setting and mount options.

Dependencies

This project depends on the functionality provided by the in-kernel mount part of the automounter enhancements. Although recently putback, this code does not yet have much test exposure.

This project is closely linked with the NFSv4 Referrals project, and will share its implementation.

Document History and Approvals

1.8 - 12th April 2007
Edited for OpenSolaris
1.7 - 16th March 2007
Use sharectl(1M) instead of SMF; change SMF Risk to discuss /etc/default/nfs

Removal of setting for auto-unmount timeout: use existing automounter setting

Observability via nfsstat(1M) "-m" output.

Inheritance of mount options (and security-related mount options)

1.6 - 27th November 2006
formal approval draft
1.5 - 6th November 2006
NFS team draft
1.3 - 20th October 2006
I-team draft

Appendices

References

Project pages, for Mirror-mounts and Referrals
http://opensolaris.org/os/project/nfs-namespace

Mount Point Crossing. NFSv4 Protocol, RFC3530 Section 7.7.
http://www.ietf.org/rfc/rfc3530.txt

Background Material

Triggering actions

The triggering actions on a target directory that will result in an automatic mirror-mount are defined in terms of their resultant vnode operations.

From an API perspective: with the single exception of stat(2), all filesystem calls involving the target directory will trigger a mount. However, a readdir(3)/getdents(2) of the parent directory enclosing the target will not trigger a mount.

For example:

Nested mirror-mounts

Automounter comparison: the automounter will only automatically mount nested mounts when encountered under /net.

Browsing

Mirror-mounts will enable a "browsing" feature similar, but not identical, to the automounter.
Existing automount browsing behaviour
When the automounter browsing option is enabled for indirect maps, it is possible to see the existence of automount trigger points before they are mounted:
estale $ ls -ld /home/alice
dr-xr-xr-x   1 root     root           1 Oct 18 12:36 /home/alice
estale $ mount | grep alice
estale $
Note that the attributes of the directory are generated by the client, and do not match reality on the server. The directory is given mode 0555, with root ownership, and the modification time is the current time. If the directory is mounted - e.g. by changing into the directory - the automounter completes the mount, and the real directory attributes are seen:
estale $ ls -ld /home/alice
drwxr-xr-x  79 alice    pawns        20480 Oct 18 13:19 /home/alice
(as well as its contents).

Note that the automounter "/net" feature is a special case, where the automounter will automatically mount any server filesystems it traverses. The functionality proposed here is almost identical, but using solely NFSv4 mechanisms, with no involvement of the automounter, and with the enhancement of correctly presenting the directory attributes during browsing. In addition, of course, it is not tied to a particular trigger-point (/net).

Existing NFSv4 server namespace browsing
In the absence of any client automount map, the existing NFSv4 server implementation in Solaris still presents the entire server namespace to the client, i.e server mounts-points (in effect) are visible to the client before the client has mounted them, even if the server mount-points themselves are on a server filesystem that is not shared:
NFSv4-server # share
-               /dum   rw=pawns   ""
-               /dee   rw=pawns   ""

# note that the server does not share "/", yet we may mount it
NFSv4-client # mount NFSv4-server:/ /mnt
NFSv4-client # ls -l /mnt
total 4
drwxr-xr-x   3 alice    pawns        512 Oct 18 15:01 dee
drwxr-xr-x  37 root     sys         1024 Oct 18 14:50 dum
This continues to provide the useful browsing feature, previously available via the automounter, without imposing the overhead of a mount, which may be important in the presence of many server filesystems e.g. when using ZFS.

Note that the attributes of the filesystems are presented correctly, even thought the client has not yet mounted them, unlike the automounter's browse feature.

However, the contents of the server's filesystems cannot be seen:

NFSv4-server # ls -al /dee
total 20
drwxr-xr-x   3 alice    pawns        512 Oct 18 15:01 .
drwxr-xr-x  31 root     root        1024 Oct 18 15:01 ..
drwx------   2 alice    pawns       8192 Oct 18 14:53 lost+found
-rw-r--r--   1 alice    pawns          0 Oct 18 14:58 this_file_is_in_slash_dee

NFSv4-client # ls -al /mnt/dee
total 4
drwxr-xr-x   3 alice    pawns        512 Oct 18 15:01 .
drwxr-xr-x  31 root     root        1024 Oct 18 15:01 ..
The proposed mirror-mount functionality would cause a real NFSv4 mount to occur when the client crosses into the new filesystem by accessing /mnt/dee.