@@ -52,7 +52,6 @@ extern void __init chrdev_init(void);
/*
* namei.c
*/
-extern int user_path_mountpoint_at(int, const char __user *, unsigned int, struct path *);
extern int vfs_path_lookup(struct dentry *, struct vfsmount *,
const char *, unsigned int, struct path *);
@@ -2722,27 +2722,6 @@ filename_mountpoint(int dfd, struct filename *name, struct path *path,
return error;
}
-/**
- * user_path_mountpoint_at - lookup a path from userland in order to umount it
- * @dfd: directory file descriptor
- * @name: pathname from userland
- * @flags: lookup flags
- * @path: pointer to container to hold result
- *
- * A umount is a special case for path walking. We're not actually interested
- * in the inode in this situation, and ESTALE errors can be a problem. We
- * simply want track down the dentry and vfsmount attached at the mountpoint
- * and avoid revalidating the last component.
- *
- * Returns 0 and populates "path" on success.
- */
-int
-user_path_mountpoint_at(int dfd, const char __user *name, unsigned int flags,
- struct path *path)
-{
- return filename_mountpoint(dfd, getname(name), path, flags);
-}
-
int
kern_path_mountpoint(int dfd, const char *name, struct path *path,
unsigned int flags)
@@ -1696,7 +1696,7 @@ SYSCALL_DEFINE2(umount, char __user *, name, int, flags)
if (!(flags & UMOUNT_NOFOLLOW))
lookup_flags |= LOOKUP_FOLLOW;
- retval = user_path_mountpoint_at(AT_FDCWD, name, lookup_flags, &path);
+ retval = user_path_at(AT_FDCWD, name, lookup_flags, &path);
if (retval)
goto out;
mnt = real_mount(path.mnt);
Now that d_weak_revalidate doesn't revalidate the inode (unless LOOKUP_OPEN is set), we don't need any extra care when umounting. A simple user_path_at() will find the desired dentry without performing any access on the mounted filesystems. So we don't need user_path_mountpoint_at(). By switching to user_path_at(), there are other changes than just the d_weak_revalidate() change. - We no longer use LOOKUP_NO_REVAL on the last component, in the unlikely case that d_lookup() failed. It is hard to see why this is relevant. Most likely if d_lookup() failed we will have called i_op->lookup, which is at least as much of a problem as d_revalidate() might be. - we now call follow_managed() on the final dentry. This cannot trigger an automount, due to the flags used, but might call ->d_manage(). There is no reason to expect that this might cause problems. So we can safely switch to user_path_at() and discard user_path_mountpoint_at(). kern_path_mountpoint() is still in use by autofs, and so cannot go just yet. Signed-off-by: NeilBrown <neilb@suse.com> --- fs/internal.h | 1 - fs/namei.c | 21 --------------------- fs/namespace.c | 2 +- 3 files changed, 1 insertion(+), 23 deletions(-)