Skip to content

Commit

Permalink
[PATCH] set mnt_namespace in the correct place
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Miklos Szeredi authored and Linus Torvalds committed Jul 8, 2005
1 parent ac08115 commit 484e389
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
1 change: 1 addition & 0 deletions fs/namespace.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
1 change: 0 additions & 1 deletion fs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 484e389

Please sign in to comment.