From 0d943642720421d039c79b2db5357884876984b0 Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Wed, 10 Feb 2010 12:15:53 +0100 Subject: [PATCH] --- yaml --- r: 185730 b: refs/heads/master c: db1f05bb85d7966b9176e293f3ceead1cb8b5d79 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/namespace.c | 9 ++++++++- trunk/include/linux/fs.h | 2 ++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index c5200657370d..0382a91bf16c 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 440b3c6c160f7d0a985f24ad1f4c24e00ee2d936 +refs/heads/master: db1f05bb85d7966b9176e293f3ceead1cb8b5d79 diff --git a/trunk/fs/namespace.c b/trunk/fs/namespace.c index ffa3843404e0..8174c8ab5c70 100644 --- a/trunk/fs/namespace.c +++ b/trunk/fs/namespace.c @@ -1136,8 +1136,15 @@ SYSCALL_DEFINE2(umount, char __user *, name, int, flags) { struct path path; int retval; + int lookup_flags = 0; - retval = user_path(name, &path); + if (flags & ~(MNT_FORCE | MNT_DETACH | MNT_EXPIRE | UMOUNT_NOFOLLOW)) + return -EINVAL; + + if (!(flags & UMOUNT_NOFOLLOW)) + lookup_flags |= LOOKUP_FOLLOW; + + retval = user_path_at(AT_FDCWD, name, lookup_flags, &path); if (retval) goto out; retval = -EINVAL; diff --git a/trunk/include/linux/fs.h b/trunk/include/linux/fs.h index e764f247d0ab..5b3182c7eb5f 100644 --- a/trunk/include/linux/fs.h +++ b/trunk/include/linux/fs.h @@ -1305,6 +1305,8 @@ extern int send_sigurg(struct fown_struct *fown); #define MNT_FORCE 0x00000001 /* Attempt to forcibily umount */ #define MNT_DETACH 0x00000002 /* Just detach from the tree */ #define MNT_EXPIRE 0x00000004 /* Mark for expiry */ +#define UMOUNT_NOFOLLOW 0x00000008 /* Don't follow symlink on umount */ +#define UMOUNT_UNUSED 0x80000000 /* Flag guaranteed to be unused */ extern struct list_head super_blocks; extern spinlock_t sb_lock;