Skip to content

Commit

Permalink
Mirror MS_KERNMOUNT in ->mnt_flags
Browse files Browse the repository at this point in the history
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Al Viro committed Mar 3, 2010
1 parent d498b25 commit 8089352
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion fs/namespace.c
Expand Up @@ -1701,7 +1701,7 @@ int do_add_mount(struct vfsmount *newmnt, struct path *path,
{
int err;

mnt_flags &= ~(MNT_SHARED | MNT_WRITE_HOLD);
mnt_flags &= ~(MNT_SHARED | MNT_WRITE_HOLD | MNT_INTERNAL);

down_write(&namespace_sem);
/* Something was mounted here while we slept */
Expand Down
3 changes: 3 additions & 0 deletions fs/super.c
Expand Up @@ -937,6 +937,9 @@ vfs_kern_mount(struct file_system_type *type, int flags, const char *name, void
if (!mnt)
goto out;

if (flags & MS_KERNMOUNT)
mnt->mnt_flags = MNT_INTERNAL;

if (data && !(type->fs_flags & FS_BINARY_MOUNTDATA)) {
secdata = alloc_secdata();
if (!secdata)
Expand Down
2 changes: 2 additions & 0 deletions include/linux/mount.h
Expand Up @@ -45,6 +45,8 @@ struct mnt_namespace;
#define MNT_PROPAGATION_MASK (MNT_SHARED | MNT_UNBINDABLE)


#define MNT_INTERNAL 0x4000

struct vfsmount {
struct list_head mnt_hash;
struct vfsmount *mnt_parent; /* fs we are mounted on */
Expand Down

0 comments on commit 8089352

Please sign in to comment.