Thread (79 messages) 79 messages, 3 authors, 2011-06-17
STALE5501d

[PATCH 04/76] VFS: Add CL_NO_SLAVE flag to clone_mnt()/copy_tree()

From: David Howells <dhowells@redhat.com>
Date: 2011-06-17 16:00:49
Subsystem: filesystems (vfs and infrastructure), the rest · Maintainers: Alexander Viro, Christian Brauner, Linus Torvalds

From: Valerie Aurora <redacted>

Passing the CL_NO_SLAVE flag to clone_mnt() causes the clone
to fail if the source mnt is a slave.

Cc: Ram Pai <redacted>
---

 fs/namespace.c |    3 +++
 fs/pnode.h     |    1 +
 2 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/fs/namespace.c b/fs/namespace.c
index c10394d..a9e5e06 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -710,6 +710,9 @@ static struct vfsmount *clone_mnt(struct vfsmount *old, struct dentry *root,
 	if ((flag & CL_NO_SHARED) && IS_MNT_SHARED(old))
 		return ERR_PTR(-EINVAL);
 
+	if ((flag & CL_NO_SLAVE) && IS_MNT_SLAVE(old))
+		return ERR_PTR(-EINVAL);
+
 	mnt = alloc_vfsmnt(old->mnt_devname);
 	if (!mnt)
 		return ERR_PTR(-ENOMEM);
diff --git a/fs/pnode.h b/fs/pnode.h
index bcb3c47..8920e47 100644
--- a/fs/pnode.h
+++ b/fs/pnode.h
@@ -23,6 +23,7 @@
 #define CL_MAKE_SHARED 		0x08
 #define CL_PRIVATE 		0x10
 #define CL_NO_SHARED 		0x20
+#define CL_NO_SLAVE 		0x40
 
 static inline void set_mnt_shared(struct vfsmount *mnt)
 {
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help