Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 24 Oct 2016 21:52:12 +0000
From:      Rick Macklem <rmacklem@uoguelph.ca>
To:        Ben Whaley <bwhaley@gmail.com>
Cc:        "freebsd-net@freebsd.org" <freebsd-net@freebsd.org>
Subject:   Re: NFSv4 exports confusion
Message-ID:  <YTXPR01MB01895ED9A49540B49BFB22C0DDA90@YTXPR01MB0189.CANPRD01.PROD.OUTLOOK.COM>
In-Reply-To: <CAOfR73jet5vB4XgyE%2B8qUDjGxD5-nQiA=icWeSU96hLkLFLFUQ@mail.gmail.com>
References:  <CAOfR73h=cqd5L_=We5yABoiDx7zbmu=guSQJRa8aF3L_-YW%2BfQ@mail.gmail.com> <YTXPR01MB0189DB96028EFB59128F6C03DDD60@YTXPR01MB0189.CANPRD01.PROD.OUTLOOK.COM>, <CAOfR73jet5vB4XgyE%2B8qUDjGxD5-nQiA=icWeSU96hLkLFLFUQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Ben Whaley wrote:

> Thank you, Rick, for taking the time to reply.
>
> In an NFSv4 server, is it possible to have multiple exports on the same
> filesystem but not under the same tree without exposing the top level
> directory?
No. The same is actually true for NFSv3, except that the Mount command won'=
t
translate the path to an FH for the mount. (Or, the NFSv3 client must find =
it via
a Lookup on "..", which clients won't  normally do.)
>
> E.g. if you wanted to export the following without also exporting /
>
> /path/to/export1
> /anotherpath/to/export2
>
> Assuming export1 and export2 are both on the same server filesystem, coul=
d
> they both be exported without exporting / as the NFSv4 root?
Again, no.

> Also, exports(5) says:
>
> > The third form has the string ``V4:=92=92 followed by a single absolute=
 path
> name, to specify the NFSv4 tree root.  > This line does not export any fi=
le
> system, but simply marks where the root of the server=92s directory tree =
is
> for > NFSv4 clients.
>
> Yet the V4 root seems to behave like a =93normal=94 export with the -alld=
irs
> option. A V4 client can mount the V4 root and any subdirectory under it,
> whether the subdir was exported or not. Am I misunderstanding what the ma=
n
> page says?
No,  if you created a /etc/exports with only a "V4:" line, no file system w=
ould be
exported. (You might be able to mount, but you wouldn't be able to do much =
of
anything with it. I don't think even a Readdir/ls works. It just allows Loo=
kup and
a few other Ops, so that the mount can work without all the parent files sy=
stems
being exported.)

It is the line that exports any path in the file system that exports that f=
ile system.
ie. It is the
/path/to/export
that exports everything in that file system.
--> So, yes, it is like all export lines except the "V4:" line have "-alldi=
rs" on them.

rick




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?YTXPR01MB01895ED9A49540B49BFB22C0DDA90>