[PATCH] set mnt_namespace in the correct place
authorMiklos Szeredi <miklos@szeredi.hu>
Fri, 8 Jul 2005 00:57:28 +0000 (17:57 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Fri, 8 Jul 2005 01:23:52 +0000 (18:23 -0700)
This patch sets ->mnt_namespace where it's actually added to the
namespace.

Previously mnt_namespace was set in do_kern_mount() even if the filesystem
was never added to any process's namespace (most kernel-internal
filesystems).

This discrepancy doesn't actually cause any problems, but it's cleaner if
mnt_namespace is NULL for these non exported filesystems.

Signed-off-by: Miklos Szeredi <miklos@szeredi.hu>
Acked-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
fs/namespace.c
fs/super.c

index 7fd56ee..b168dc3 100644 (file)
@@ -808,6 +808,7 @@ int do_add_mount(struct vfsmount *newmnt, struct nameidata *nd,
                goto unlock;
 
        newmnt->mnt_flags = mnt_flags;
+       newmnt->mnt_namespace = current->namespace;
        err = graft_tree(newmnt, nd);
 
        if (err == 0 && fslist) {
index 25bc1ec..6e57ee2 100644 (file)
@@ -840,7 +840,6 @@ do_kern_mount(const char *fstype, int flags, const char *name, void *data)
        mnt->mnt_root = dget(sb->s_root);
        mnt->mnt_mountpoint = sb->s_root;
        mnt->mnt_parent = mnt;
-       mnt->mnt_namespace = current->namespace;
        up_write(&sb->s_umount);
        free_secdata(secdata);
        put_filesystem(type);