Skip to contentSkip to conversation

exports.man: improve documentation of 'nohide' and 'crossmnt'

PATCH/RFC nfs-utils NeilBrown 4 participants 9 messages Feb 16, 2015 – Feb 26, 2015

Subsystems (2)
lore
Share & tools
lore

NeilBrown

author
#0 lore raw

- note that 'nohide' is irrelevant for NFSv4
- note that children on a 'crossmnt' filesystem cannot be unexported
- note that 'nocrossmnt' is a valid option, but probably not useful.

---

I wonder if we should add a new option, e.g. "noaccess" so that children of a "crossmnt" filesystem can be hidden. The kernel wouldn't need to know about this. It would just tell mountd to refuse to export that filesystem even if the parent was "crossmnt".
??

NeilBrown

utils/exportfs/exports.man +36 -6
index 3d974d92a729..88d9fbebe386 100644
@@ -218,16 +218,46 @@ This option can be very useful in some situations, but it should be
 used with due care, and only after confirming that the client system
 copes with the situation effectively.
 
-The option can be explicitly disabled with
+The option can be explicitly disabled for NFSv2 and NFSv3 with
 .IR hide .
+
+This option is not relevant when NFSv4 is use.  NFSv4 never hides
+subordinate filesystems.  Any filesystem that is exported will be
+visible where expected when using NFSv4.
 .TP
-.IR crossmnt
+.I crossmnt
 This option is similar to
 .I nohide
-but it makes it possible for clients to move from the filesystem marked
-with crossmnt to exported filesystems mounted on it.  Thus when a child
-filesystem "B" is mounted on a parent "A", setting crossmnt on "A" has
-the same effect as setting "nohide" on B.
+but it makes it possible for clients to access all filesystems mounted
+on a filesystem marked with
+.IR crossmnt .
+Thus when a child filesystem "B" is mounted on a parent "A", setting
+crossmnt on "A" has a similar effect to setting "nohide" on B.
+
+With
+.I nohide
+the child filesystem needs to be explicitly exported.  With
+.I crossmnt
+it need not.  If a child of a
+.I crossmnt
+file is not explicitly exported, then it will be implicitly exported
+with the same export options as the parent, except for
+.IR fsid= .
+This makes it impossible to
+.B not
+export a child of a
+.I crossmnt
+filesystem.  If some but not all subordinate filesystems of a parent
+are to be exported, then they must be explicitly exported and the
+parent should not have
+.I crossmnt
+set.
+
+The
+.I nocrossmnt
+option can explictly disable
+.I crossmnt
+if it was previously set.  This is rarely useful.
 .TP
 .IR no_subtree_check
 This option disables subtree checking, which has mild security
#1 lore raw
Quoted 8 lines · NeilBrown

- note that 'nohide' is irrelevant for NFSv4
- note that children on a 'crossmnt' filesystem cannot be unexported
- note that 'nocrossmnt' is a valid option, but probably not useful.

Quoted 7 lines

---

I wonder if we should add a new option, e.g. "noaccess" so that children of a "crossmnt" filesystem can be hidden. The kernel wouldn't need to know about this. It would just tell mountd to refuse to export that filesystem even if the parent was "crossmnt".
??

Seems logical enough, but I can't recall seeing requests for it, and the options here already seem complicated enough.

In theory something like that could also be done with namespaces. (So, run mountd in a separate mount namespace that lacks those children.)

--b.

Quoted 61 lines

NeilBrown

utils/exportfs/exports.man +36 -6
index 3d974d92a729..88d9fbebe386 100644
@@ -218,16 +218,46 @@ This option can be very useful in some situations, but it should be
 used with due care, and only after confirming that the client system
 copes with the situation effectively.
 
-The option can be explicitly disabled with
+The option can be explicitly disabled for NFSv2 and NFSv3 with
 .IR hide .
+
+This option is not relevant when NFSv4 is use.  NFSv4 never hides
+subordinate filesystems.  Any filesystem that is exported will be
+visible where expected when using NFSv4.
 .TP
-.IR crossmnt
+.I crossmnt
 This option is similar to
 .I nohide
-but it makes it possible for clients to move from the filesystem marked
-with crossmnt to exported filesystems mounted on it.  Thus when a child
-filesystem "B" is mounted on a parent "A", setting crossmnt on "A" has
-the same effect as setting "nohide" on B.
+but it makes it possible for clients to access all filesystems mounted
+on a filesystem marked with
+.IR crossmnt .
+Thus when a child filesystem "B" is mounted on a parent "A", setting
+crossmnt on "A" has a similar effect to setting "nohide" on B.
+
+With
+.I nohide
+the child filesystem needs to be explicitly exported.  With
+.I crossmnt
+it need not.  If a child of a
+.I crossmnt
+file is not explicitly exported, then it will be implicitly exported
+with the same export options as the parent, except for
+.IR fsid= .
+This makes it impossible to
+.B not
+export a child of a
+.I crossmnt
+filesystem.  If some but not all subordinate filesystems of a parent
+are to be exported, then they must be explicitly exported and the
+parent should not have
+.I crossmnt
+set.
+
+The
+.I nocrossmnt
+option can explictly disable
+.I crossmnt
+if it was previously set.  This is rarely useful.
 .TP
 .IR no_subtree_check
 This option disables subtree checking, which has mild security
#2 lore raw
Quoted 17 lines · J. Bruce Fields
Quoted 8 lines · NeilBrown

- note that 'nohide' is irrelevant for NFSv4
- note that children on a 'crossmnt' filesystem cannot be unexported
- note that 'nocrossmnt' is a valid option, but probably not useful.

Quoted 7 lines

---

I wonder if we should add a new option, e.g. "noaccess" so that children of a "crossmnt" filesystem can be hidden. The kernel wouldn't need to know about this. It would just tell mountd to refuse to export that filesystem even if the parent was "crossmnt".
??

Quoted 5 lines

Seems logical enough, but I can't recall seeing requests for it, and the options here already seem complicated enough.

In theory something like that could also be done with namespaces. (So, run mountd in a separate mount namespace that lacks those children.)

Agreed. It seems unnecessarily complicated to add yet another option to the crossmnt/nohide saga. If the "nohide" documentation is too complex, then we should rather aim to improve that documentation.

Signature · 3 lines
Trond Myklebust
Linux NFS client maintainer, PrimaryData
[email protected]
author
#3 lore raw
Quoted 21 lines · On Mon, 16 Feb 2015 18:06:06 -0500 Trond Myklebust…
Quoted 20 lines · J. Bruce Fields
Quoted 8 lines · NeilBrown

- note that 'nohide' is irrelevant for NFSv4
- note that children on a 'crossmnt' filesystem cannot be unexported
- note that 'nocrossmnt' is a valid option, but probably not useful.

Quoted 7 lines

---

I wonder if we should add a new option, e.g. "noaccess" so that children of a "crossmnt" filesystem can be hidden. The kernel wouldn't need to know about this. It would just tell mountd to refuse to export that filesystem even if the parent was "crossmnt".
??

Seems logical enough, but I can't recall seeing requests for it, and the options here already seem complicated enough.

Quoted 7 lines
Quoted 2 lines

In theory something like that could also be done with namespaces. (So, run mountd in a separate mount namespace that lacks those children.)

Agreed. It seems unnecessarily complicated to add yet another option to the crossmnt/nohide saga. If the "nohide" documentation is too complex, then we should rather aim to improve that documentation.

Yes - improving the documentation was my first step, hence this patch.

Writing that documentation lead me to see that a particular configuration was impossible - hence the question.

I have no strong desire for a change, and that seems to be common among others, so let's just drop it.

Thanks,
NeilBrown

author
#4 lore raw
In reply to J. Bruce Fields
Quoted 11 lines · On Mon, 16 Feb 2015 15:17:51 -0500 [email protected] (J. Bruce Fields) wrote:
Quoted 10 lines · NeilBrown

- note that 'nohide' is irrelevant for NFSv4
- note that children on a 'crossmnt' filesystem cannot be unexported
- note that 'nocrossmnt' is a valid option, but probably not useful.

---

Quoted 8 lines
Quoted 5 lines

I wonder if we should add a new option, e.g. "noaccess" so that children of a "crossmnt" filesystem can be hidden. The kernel wouldn't need to know about this. It would just tell mountd to refuse to export that filesystem even if the parent was "crossmnt".
??

Seems logical enough, but I can't recall seeing requests for it, and the options here already seem complicated enough.

I haven't seem requests myself. Just rumours of 'nohide' not working with NFSv4, which seems to suggest that someone wants something like that. But I cannot find a clear source.

Maybe:

http://ubuntuforums.org/showthread.php?t=2152643
http://ubuntuforums.org/showthread.php?t=1603881

Quoted 3 lines

In theory something like that could also be done with namespaces. (So, run mountd in a separate mount namespace that lacks those children.)

Do any of the NFS man pages need to be updated to say something about namespaces?

NeilBrown

#5 lore raw
Quoted 34 lines · NeilBrown
Quoted 11 lines · On Mon, 16 Feb 2015 15:17:51 -0500 [email protected] (J. Bruce Fields) wrote:
Quoted 10 lines · NeilBrown

- note that 'nohide' is irrelevant for NFSv4
- note that children on a 'crossmnt' filesystem cannot be unexported
- note that 'nocrossmnt' is a valid option, but probably not useful.

---

Quoted 8 lines
Quoted 5 lines

I wonder if we should add a new option, e.g. "noaccess" so that children of a "crossmnt" filesystem can be hidden. The kernel wouldn't need to know about this. It would just tell mountd to refuse to export that filesystem even if the parent was "crossmnt".
??

Seems logical enough, but I can't recall seeing requests for it, and the options here already seem complicated enough.

I haven't seem requests myself. Just rumours of 'nohide' not working with NFSv4, which seems to suggest that someone wants something like that. But I cannot find a clear source.

Maybe:

http://ubuntuforums.org/showthread.php?t=2152643
http://ubuntuforums.org/showthread.php?t=1603881

Quoted 1 line
Quoted 5 lines
Quoted 2 lines

In theory something like that could also be done with namespaces. (So, run mountd in a separate mount namespace that lacks those children.)

Do any of the NFS man pages need to be updated to say something about namespaces?

Maybe just a note in the rpc.mountd man page that export paths are all with respect to the mount namespace rpc.mountd is running in?

--b.

author
#6 lore raw
Quoted 35 lines · On Tue, 17 Feb 2015 20:54:32 -0500 "J. Bruce Fields" <[email protected]>…
Quoted 34 lines · NeilBrown
Quoted 11 lines · On Mon, 16 Feb 2015 15:17:51 -0500 [email protected] (J. Bruce Fields) wrote:
Quoted 10 lines · NeilBrown

- note that 'nohide' is irrelevant for NFSv4
- note that children on a 'crossmnt' filesystem cannot be unexported
- note that 'nocrossmnt' is a valid option, but probably not useful.

---

Quoted 8 lines
Quoted 5 lines

I wonder if we should add a new option, e.g. "noaccess" so that children of a "crossmnt" filesystem can be hidden. The kernel wouldn't need to know about this. It would just tell mountd to refuse to export that filesystem even if the parent was "crossmnt".
??

Seems logical enough, but I can't recall seeing requests for it, and the options here already seem complicated enough.

I haven't seem requests myself. Just rumours of 'nohide' not working with NFSv4, which seems to suggest that someone wants something like that. But I cannot find a clear source.

Maybe:

http://ubuntuforums.org/showthread.php?t=2152643
http://ubuntuforums.org/showthread.php?t=1603881

Quoted 1 line
Quoted 9 lines
Quoted 5 lines
Quoted 2 lines

In theory something like that could also be done with namespaces. (So, run mountd in a separate mount namespace that lacks those children.)

Do any of the NFS man pages need to be updated to say something about namespaces?

Maybe just a note in the rpc.mountd man page that export paths are all with respect to the mount namespace rpc.mountd is running in?

I assume that implies that there can only ever be one rpc.mountd running?

I haven't really been following, but I assumed we would end up with a different rpc.mountd in each of several different namespaces, each one seeing a different cache through a differently configured /proc..

And somehow there would be different nfsds in different network namespaces, each tied to a filesystem namespace ... or something.

I guess that isn't want is really happening?

Thanks,
NeilBrown

#7 lore raw
Quoted 48 lines · NeilBrown
Quoted 35 lines · On Tue, 17 Feb 2015 20:54:32 -0500 "J. Bruce Fields" <[email protected]>…
Quoted 34 lines · NeilBrown
Quoted 11 lines · On Mon, 16 Feb 2015 15:17:51 -0500 [email protected] (J. Bruce Fields) wrote:
Quoted 10 lines · NeilBrown

- note that 'nohide' is irrelevant for NFSv4
- note that children on a 'crossmnt' filesystem cannot be unexported
- note that 'nocrossmnt' is a valid option, but probably not useful.

---

Quoted 8 lines
Quoted 5 lines

I wonder if we should add a new option, e.g. "noaccess" so that children of a "crossmnt" filesystem can be hidden. The kernel wouldn't need to know about this. It would just tell mountd to refuse to export that filesystem even if the parent was "crossmnt".
??

Seems logical enough, but I can't recall seeing requests for it, and the options here already seem complicated enough.

I haven't seem requests myself. Just rumours of 'nohide' not working with NFSv4, which seems to suggest that someone wants something like that. But I cannot find a clear source.

Maybe:

http://ubuntuforums.org/showthread.php?t=2152643
http://ubuntuforums.org/showthread.php?t=1603881

Quoted 1 line
Quoted 9 lines
Quoted 5 lines
Quoted 2 lines

In theory something like that could also be done with namespaces. (So, run mountd in a separate mount namespace that lacks those children.)

Do any of the NFS man pages need to be updated to say something about namespaces?

Maybe just a note in the rpc.mountd man page that export paths are all with respect to the mount namespace rpc.mountd is running in?

Quoted 5 lines

I assume that implies that there can only ever be one rpc.mountd running?

I haven't really been following, but I assumed we would end up with a different rpc.mountd in each of several different namespaces, each one seeing a different cache through a differently configured /proc..

Right, so in the simple case there's one rpc.mountd, and export paths are interpreted with respect to that rpc.mountd's namespace.

If you have multiple network namespaces, then you can independently start and stop nfsd's in each network namespace, each talking to its own rpc.mountd.

Quoted 5 lines

And somehow there would be different nfsds in different network namespaces, each tied to a filesystem namespace ... or something.

I guess that isn't want is really happening?

So, yes, that's the idea.

NFSv4 doesn't work because of the unfinished usermode helper containerization stuff Ian Kent's working on. And I don't think anyone's really used any of this so there may be other lurking bugs. May still make sense to document what we have so far, though.

--b.

#8 lore raw
In reply to NeilBrown
Quoted 7 lines · NeilBrown

- note that 'nohide' is irrelevant for NFSv4
- note that children on a 'crossmnt' filesystem cannot be unexported
- note that 'nocrossmnt' is a valid option, but probably not useful.

Committed!

steved.

Quoted 70 lines

---

I wonder if we should add a new option, e.g. "noaccess" so that children of a "crossmnt" filesystem can be hidden. The kernel wouldn't need to know about this. It would just tell mountd to refuse to export that filesystem even if the parent was "crossmnt".
??

NeilBrown

utils/exportfs/exports.man +36 -6
index 3d974d92a729..88d9fbebe386 100644
@@ -218,16 +218,46 @@ This option can be very useful in some situations, but it should be
 used with due care, and only after confirming that the client system
 copes with the situation effectively.
 
-The option can be explicitly disabled with
+The option can be explicitly disabled for NFSv2 and NFSv3 with
 .IR hide .
+
+This option is not relevant when NFSv4 is use.  NFSv4 never hides
+subordinate filesystems.  Any filesystem that is exported will be
+visible where expected when using NFSv4.
 .TP
-.IR crossmnt
+.I crossmnt
 This option is similar to
 .I nohide
-but it makes it possible for clients to move from the filesystem marked
-with crossmnt to exported filesystems mounted on it.  Thus when a child
-filesystem "B" is mounted on a parent "A", setting crossmnt on "A" has
-the same effect as setting "nohide" on B.
+but it makes it possible for clients to access all filesystems mounted
+on a filesystem marked with
+.IR crossmnt .
+Thus when a child filesystem "B" is mounted on a parent "A", setting
+crossmnt on "A" has a similar effect to setting "nohide" on B.
+
+With
+.I nohide
+the child filesystem needs to be explicitly exported.  With
+.I crossmnt
+it need not.  If a child of a
+.I crossmnt
+file is not explicitly exported, then it will be implicitly exported
+with the same export options as the parent, except for
+.IR fsid= .
+This makes it impossible to
+.B not
+export a child of a
+.I crossmnt
+filesystem.  If some but not all subordinate filesystems of a parent
+are to be exported, then they must be explicitly exported and the
+parent should not have
+.I crossmnt
+set.
+
+The
+.I nocrossmnt
+option can explictly disable
+.I crossmnt
+if it was previously set.  This is rarely useful.
 .TP
 .IR no_subtree_check
 This option disables subtree checking, which has mild security