X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=fs%2Fnamespace.c;h=03f43da1f9cea4c9aac380420a5aafec578eb690;hb=34a75f0025b9cf803b6a88db032e6ad6950c9313;hp=9454e3cf3fd47d2afe37e8921db59a8f9c470340;hpb=43bc926fffd92024b46cafaf7350d669ba9ca884;p=linux-2.6.git diff --git a/fs/namespace.c b/fs/namespace.c index 9454e3cf3..03f43da1f 100644 --- a/fs/namespace.c +++ b/fs/namespace.c @@ -449,17 +449,27 @@ static int show_vfsstat(struct seq_file *m, void *v) struct vfsmount *mnt = v; int err = 0; - /* device */ - if (mnt->mnt_devname) { - seq_puts(m, "device "); - mangle(m, mnt->mnt_devname); - } else - seq_puts(m, "no device"); - - /* mount point */ - seq_puts(m, " mounted on "); - seq_path(m, mnt, mnt->mnt_root, " \t\n\\"); - seq_putc(m, ' '); + if (vx_flags(VXF_HIDE_MOUNT, 0)) + return 0; + if (!mnt_is_reachable(mnt) && !vx_check(0, VX_WATCH)) + return 0; + + if (!vx_check(0, VX_ADMIN|VX_WATCH) && + mnt == current->fs->rootmnt) { + seq_puts(m, "device /dev/root mounted on / "); + } else { + /* device */ + if (mnt->mnt_devname) { + seq_puts(m, "device "); + mangle(m, mnt->mnt_devname); + } else + seq_puts(m, "no device"); + + /* mount point */ + seq_puts(m, " mounted on "); + seq_path(m, mnt, mnt->mnt_root, " \t\n\\"); + seq_putc(m, ' '); + } /* file system type */ seq_puts(m, "with fstype "); @@ -558,11 +568,15 @@ void release_mounts(struct list_head *head) } } -static inline void __umount_list(struct vfsmount *mnt, - int propagate, struct list_head *kill) +void umount_tree(struct vfsmount *mnt, int propagate, struct list_head *kill) { struct vfsmount *p; + for (p = mnt; p; p = next_mnt(p, mnt)) { + list_del(&p->mnt_hash); + list_add(&p->mnt_hash, kill); + } + if (propagate) propagate_umount(kill); @@ -578,33 +592,6 @@ static inline void __umount_list(struct vfsmount *mnt, } } -void umount_tree(struct vfsmount *mnt, int propagate, struct list_head *kill) -{ - struct vfsmount *p; - - for (p = mnt; p; p = next_mnt(p, mnt)) { - list_del(&p->mnt_hash); - list_add(&p->mnt_hash, kill); - // p->mnt_namespace = NULL; - } - __umount_list(mnt, propagate, kill); -} - -void umount_unused(struct vfsmount *mnt, struct fs_struct *fs) -{ - struct vfsmount *p; - LIST_HEAD(kill); - - for (p = mnt; p; p = next_mnt(p, mnt)) { - if (p == fs->rootmnt || p == fs->pwdmnt) - continue; - list_del(&p->mnt_list); - list_add(&p->mnt_list, &kill); - p->mnt_namespace = NULL; - } - __umount_list(mnt, 0, &kill); -} - static int do_umount(struct vfsmount *mnt, int flags) { struct super_block *sb = mnt->mnt_sb; @@ -1422,7 +1409,7 @@ long do_mount(char *dev_name, char *dir_name, char *type_page, if (flags & MS_NODIRATIME) mnt_flags |= MNT_NODIRATIME; - if (vx_ccaps(VXC_SECURE_MOUNT)) + if (!capable(CAP_SYS_ADMIN)) mnt_flags |= MNT_NODEV; flags &= ~(MS_NOSUID | MS_NOEXEC | MS_NODEV | MS_ACTIVE | MS_NOATIME | MS_NODIRATIME);