summaryrefslogtreecommitdiffstats
path: root/fs/mount.h
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2019-01-30 13:30:21 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2019-01-30 17:44:07 -0500
commit74e831221cfd79460ec11c1b641093863f0ef3ce (patch)
tree270fb98f1e5bebd78a90554690a3ffe560f3690f /fs/mount.h
parent3bd045cc9c4be2049602b47505256b43908b4e2f (diff)
downloadlinux-stable-74e831221cfd79460ec11c1b641093863f0ef3ce.tar.gz
linux-stable-74e831221cfd79460ec11c1b641093863f0ef3ce.tar.bz2
linux-stable-74e831221cfd79460ec11c1b641093863f0ef3ce.zip
saner handling of temporary namespaces
mount_subtree() creates (and soon destroys) a temporary namespace, so that automounts could function normally. These beasts should never become anyone's current namespaces; they don't, but it would be better to make prevention of that more straightforward. And since they don't become anyone's current namespace, we don't need to bother with reserving procfs inums for those. Teach alloc_mnt_ns() to skip inum allocation if told so, adjust put_mnt_ns() accordingly, make mount_subtree() use temporary (anon) namespace. is_anon_ns() checks if a namespace is such. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/mount.h')
-rw-r--r--fs/mount.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/mount.h b/fs/mount.h
index f39bc9da4d73..6250de544760 100644
--- a/fs/mount.h
+++ b/fs/mount.h
@@ -146,3 +146,8 @@ static inline bool is_local_mountpoint(struct dentry *dentry)
return __is_local_mountpoint(dentry);
}
+
+static inline bool is_anon_ns(struct mnt_namespace *ns)
+{
+ return ns->seq == 0;
+}