nfsd: introduce export flag for v4 pseudoroot
authorSteve Dickson <SteveD@redhat.com>
Wed, 9 Sep 2009 18:58:22 +0000 (14:58 -0400)
committerJ. Bruce Fields <bfields@citi.umich.edu>
Tue, 15 Dec 2009 19:00:40 +0000 (14:00 -0500)
commiteb4c86c6a5adec423c9e615d4937fdddd06a16c5
tree50aee7013c9ca92cce9828268af4ee3d220a416c
parent12045a6ee9908b38b6d286530c7d816e39071346
nfsd: introduce export flag for v4 pseudoroot

NFSv4 differs from v2 and v3 in that it presents a single unified
filesystem tree, whereas v2 and v3 exported multiple filesystem (whose
roots could be found using a separate mount protocol).

Our original NFSv4 server implementation asked the administrator to
designate a single filesystem as the NFSv4 root, then to mount
filesystems they wished to export underneath.  (Often using bind mounts
of already-existing filesystems.)

This was conceptually simple, and allowed easy implementation, but
created a serious obstacle to upgrading between v2/v3: since the paths
to v4 filesystems were different, administrators would have to adjust
all the paths in client-side mount commands when switching to v4.

Various workarounds are possible.  For example, the administrator could
export "/" and designate it as the v4 root.  However, the security risks
of that approach are obvious, and in any case we shouldn't be requiring
the administrator to take extra steps to fix this problem; instead, the
server should present consistent paths across different versions by
default.

These patches take a modified version of that approach: we provide a new
export option which exports only a subset of a filesystem.  With this
flag, it becomes safe for mountd to export "/" by default, with no need
for additional configuration.

We begin just by defining the new flag.

Signed-off-by: Steve Dickson <steved@redhat.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
fs/nfsd/export.c
include/linux/nfsd/export.h