summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Stultz <johnstul@us.ibm.com>2010-04-28 12:39:45 +0200
committerThomas Gleixner <tglx@linutronix.de>2010-04-28 22:54:13 +0200
commit5e022ed205b9408a98822d291a4c2b9dd675a91e (patch)
tree0a5f78dc1d7426a2f2a0131ad3c9c6c4387b533d
parent4b44047bffdaf134f84b683efed4d828c9d2f87b (diff)
downloadlwn-5e022ed205b9408a98822d291a4c2b9dd675a91e.tar.gz
lwn-5e022ed205b9408a98822d291a4c2b9dd675a91e.zip
fs: namespace: Fix MNT_MOUNTED handling for cloned rootfs
We don't call attach_mnt on a cloned rootfs so set the MNT_MOUNTED flag in copy_tree(). Signed-off-by: John Stultz <johnstul@us.ibm.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r--fs/namespace.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/namespace.c b/fs/namespace.c
index d8924bfaa9db..6c115d86a157 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -1377,6 +1377,13 @@ struct vfsmount *copy_tree(struct vfsmount *mnt, struct dentry *dentry,
goto Enomem;
q->mnt_mountpoint = mnt->mnt_mountpoint;
+ /*
+ * We don't call attach_mnt on a cloned rootfs, so set it as
+ * mounted here.
+ */
+ WARN_ON(q->mnt_flags & MNT_MOUNTED);
+ q->mnt_flags |= MNT_MOUNTED;
+
p = mnt;
list_for_each_entry(r, &mnt->mnt_mounts, mnt_child) {
if (!is_subdir(r->mnt_mountpoint, dentry))