diff options
-rw-r--r-- | fs/namespace.c | 9 | ||||
-rw-r--r-- | include/linux/fs.h | 2 |
2 files changed, 10 insertions, 1 deletions
diff --git a/fs/namespace.c b/fs/namespace.c index ffa3843404e0..8174c8ab5c70 100644 --- a/fs/namespace.c +++ b/fs/namespace.c | |||
@@ -1136,8 +1136,15 @@ SYSCALL_DEFINE2(umount, char __user *, name, int, flags) | |||
1136 | { | 1136 | { |
1137 | struct path path; | 1137 | struct path path; |
1138 | int retval; | 1138 | int retval; |
1139 | int lookup_flags = 0; | ||
1139 | 1140 | ||
1140 | retval = user_path(name, &path); | 1141 | if (flags & ~(MNT_FORCE | MNT_DETACH | MNT_EXPIRE | UMOUNT_NOFOLLOW)) |
1142 | return -EINVAL; | ||
1143 | |||
1144 | if (!(flags & UMOUNT_NOFOLLOW)) | ||
1145 | lookup_flags |= LOOKUP_FOLLOW; | ||
1146 | |||
1147 | retval = user_path_at(AT_FDCWD, name, lookup_flags, &path); | ||
1141 | if (retval) | 1148 | if (retval) |
1142 | goto out; | 1149 | goto out; |
1143 | retval = -EINVAL; | 1150 | retval = -EINVAL; |
diff --git a/include/linux/fs.h b/include/linux/fs.h index e764f247d0ab..5b3182c7eb5f 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -1305,6 +1305,8 @@ extern int send_sigurg(struct fown_struct *fown); | |||
1305 | #define MNT_FORCE 0x00000001 /* Attempt to forcibily umount */ | 1305 | #define MNT_FORCE 0x00000001 /* Attempt to forcibily umount */ |
1306 | #define MNT_DETACH 0x00000002 /* Just detach from the tree */ | 1306 | #define MNT_DETACH 0x00000002 /* Just detach from the tree */ |
1307 | #define MNT_EXPIRE 0x00000004 /* Mark for expiry */ | 1307 | #define MNT_EXPIRE 0x00000004 /* Mark for expiry */ |
1308 | #define UMOUNT_NOFOLLOW 0x00000008 /* Don't follow symlink on umount */ | ||
1309 | #define UMOUNT_UNUSED 0x80000000 /* Flag guaranteed to be unused */ | ||
1308 | 1310 | ||
1309 | extern struct list_head super_blocks; | 1311 | extern struct list_head super_blocks; |
1310 | extern spinlock_t sb_lock; | 1312 | extern spinlock_t sb_lock; |