lkml.org 
[lkml]   [2004]   [Oct]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH 26/28] VFS: Introduce MNT_NOFOLLOW
Date
From
Umounting direct mounts requires the ability to umount without following
->follow_link. We do this by adding a new flag called MNT_NOFOLLOW to
umount2.

Signed-off-by: Mike Waychison <michael.waychison@sun.com>
---

fs/namespace.c | 3 ++-
include/linux/fs.h | 1 +
2 files changed, 3 insertions(+), 1 deletion(-)

Index: linux-2.6.9-quilt/include/linux/fs.h
===================================================================
--- linux-2.6.9-quilt.orig/include/linux/fs.h 2004-10-22 17:17:43.766810576 -0400
+++ linux-2.6.9-quilt/include/linux/fs.h 2004-10-22 17:17:47.808196192 -0400
@@ -735,6 +735,7 @@ extern int send_sigurg(struct fown_struc

#define MNT_FORCE 0x00000001 /* Attempt to forcibily umount */
#define MNT_DETACH 0x00000002 /* Just detach from the tree */
+#define MNT_NOFOLLOW 0x00000004 /* Do not follow symlinks */

extern struct list_head super_blocks;
extern spinlock_t sb_lock;
Index: linux-2.6.9-quilt/fs/namespace.c
===================================================================
--- linux-2.6.9-quilt.orig/fs/namespace.c 2004-10-22 17:17:45.491548376 -0400
+++ linux-2.6.9-quilt/fs/namespace.c 2004-10-22 17:17:47.809196040 -0400
@@ -693,8 +693,9 @@ asmlinkage long sys_umount(char __user *
{
struct nameidata nd;
int retval;
+ int walk_flags = flags & MNT_NOFOLLOW ? 0 : LOOKUP_FOLLOW;

- retval = __user_walk(name, LOOKUP_FOLLOW, &nd);
+ retval = __user_walk(name, walk_flags, &nd);
if (retval)
goto out;
retval = -EINVAL;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:07    [W:0.054 / U:0.368 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site