diff -NurpP --minimal a/fs/namespace.c b/fs/namespace.c --- a/fs/namespace.c 2005-03-09 13:43:26.000000000 +0100 +++ b/fs/namespace.c 2005-03-10 20:09:36.000000000 +0100 @@ -245,13 +245,17 @@ static int show_vfsmnt(struct seq_file * if (vx_flags(VXF_HIDE_MOUNT, 0)) return 0; - if (!vx_check_vfsmount(current->vx_info, mnt)) + if (!vx_check_vfsmount(mnt)) return 0; - mangle(m, mnt->mnt_devname ? mnt->mnt_devname : "none"); - seq_putc(m, ' '); - seq_path(m, mnt, mnt->mnt_root, " \t\n\\"); - seq_putc(m, ' '); + if (current->xid && mnt == current->fs->rootmnt) { + seq_puts(m, "/dev/root / "); + } else { + mangle(m, mnt->mnt_devname ? mnt->mnt_devname : "none"); + seq_putc(m, ' '); + seq_path(m, mnt, mnt->mnt_root, " \t\n\\"); + seq_putc(m, ' '); + } mangle(m, mnt->mnt_sb->s_type->name); seq_puts(m, mnt->mnt_sb->s_flags & MS_RDONLY ? " ro" : " rw"); for (fs_infop = fs_info; fs_infop->flag; fs_infop++) { diff -NurpP --minimal a/include/linux/vserver/namespace.h b/include/linux/vserver/namespace.h --- a/include/linux/vserver/namespace.h 2005-03-09 13:43:26.000000000 +0100 +++ b/include/linux/vserver/namespace.h 2005-03-10 20:10:07.000000000 +0100 @@ -46,7 +46,7 @@ struct namespace; struct fs_struct; struct vfsmount; -extern int vx_check_vfsmount(struct vx_info *, struct vfsmount *); +extern int vx_check_vfsmount(struct vfsmount *); extern int vx_set_namespace(struct vx_info *, struct namespace *, struct fs_struct *); diff -NurpP --minimal a/kernel/vserver/namespace.c b/kernel/vserver/namespace.c --- a/kernel/vserver/namespace.c 2005-03-09 13:43:26.000000000 +0100 +++ b/kernel/vserver/namespace.c 2005-03-10 20:08:38.000000000 +0100 @@ -17,54 +17,41 @@ #include #include #include +#include #include #include #include -int vx_check_vfsmount(struct vx_info *vxi, struct vfsmount *mnt) +int vx_check_vfsmount(struct vfsmount *mnt) { - struct vfsmount *root_mnt, *altroot_mnt; - struct dentry *root, *altroot, *point; - int r1, r2, s1, s2, ret = 0; + struct vfsmount *root_mnt; + struct dentry *root, *point; + int ret; - if (!vxi || !mnt) + if (!mnt) return 1; - spin_lock(&dcache_lock); - altroot_mnt = current->fs->rootmnt; - altroot = current->fs->root; - point = altroot; + /* rootfs */ + if (mnt == mnt->mnt_namespace->root) + return 1; - if (vxi->vx_fs) { - root_mnt = vxi->vx_fs->rootmnt; - root = vxi->vx_fs->root; - } else { - root_mnt = altroot_mnt; - root = altroot; - } - /* printk("··· %p:%p/%p:%p ", - root_mnt, root, altroot_mnt, altroot); */ + spin_lock(&dcache_lock); + root_mnt = current->fs->rootmnt; + root = current->fs->root; + point = root; - while ((mnt != mnt->mnt_parent) && - (mnt != root_mnt) && (mnt != altroot_mnt)) { + while ((mnt != mnt->mnt_parent) && (mnt != root_mnt)) { point = mnt->mnt_mountpoint; mnt = mnt->mnt_parent; } - r1 = (mnt == root_mnt); - s1 = is_subdir(point, root); - r2 = (mnt == altroot_mnt); - s2 = is_subdir(point, altroot); + ret = (mnt == root_mnt) && is_subdir(point, root); - ret = (((mnt == root_mnt) && is_subdir(point, root)) || - ((mnt == altroot_mnt) && is_subdir(point, altroot))); - /* printk("··· for %p:%p -> %d:%d/%d:%d = %d\n", - mnt, point, r1, s1, r2, s2, ret); */ spin_unlock(&dcache_lock); - return (r2 && s2); + return ret; }