[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1284675145-4391-4-git-send-email-vaurora@redhat.com>
Date: Thu, 16 Sep 2010 15:11:54 -0700
From: Valerie Aurora <vaurora@...hat.com>
To: Alexander Viro <viro@...iv.linux.org.uk>
Cc: Miklos Szeredi <miklos@...redi.hu>,
Christoph Hellwig <hch@...radead.org>,
Andreas Gruenbacher <agruen@...e.de>,
Nick Piggin <npiggin@...nel.dk>, linux-kernel@...r.kernel.org,
linux-fsdevel@...r.kernel.org, Valerie Aurora <vaurora@...hat.com>
Subject: [PATCH 03/34] VFS: Add CL_NO_SLAVE flag to clone_mnt()/copy_tree()
Passing the CL_NO_SLAVE flag to clone_mnt() causes the clone
to fail if the source mnt is a slave.
Signed-off-by: Valerie Aurora <vaurora@...hat.com>
---
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 eeb4c22..6956062 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -565,6 +565,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)
{
--
1.6.3.3
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists