pid namespaces: introduce MS_KERNMOUNT flag

This flag tells the .get_sb callback that this is a kern_mount() call so that
it can trust *data pointer to be valid in-kernel one.  If this flag is passed
from the user process, it is cleared since the *data pointer is not a valid
kernel object.

Running a few steps forward - this will be needed for proc to create the
superblock and store a valid pid namespace on it during the namespace
creation.  The reason, why the namespace cannot live without proc mount is
described in the appropriate patch.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Cc: Oleg Nesterov <oleg@tv-sign.ru>
Cc: Sukadev Bhattiprolu <sukadev@us.ibm.com>
Cc: Paul Menage <menage@google.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Pavel Emelyanov
2007-10-18 23:40:02 -07:00
committed by Linus Torvalds
parent 2e4a707269
commit 8bf9725c29
3 changed files with 7 additions and 5 deletions

View File

@ -944,9 +944,9 @@ do_kern_mount(const char *fstype, int flags, const char *name, void *data)
return mnt;
}
struct vfsmount *kern_mount(struct file_system_type *type)
struct vfsmount *kern_mount_data(struct file_system_type *type, void *data)
{
return vfs_kern_mount(type, 0, type->name, NULL);
return vfs_kern_mount(type, MS_KERNMOUNT, type->name, data);
}
EXPORT_SYMBOL(kern_mount);
EXPORT_SYMBOL_GPL(kern_mount_data);