aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/namei.c10
-rw-r--r--fs/namespace.c4
-rw-r--r--include/linux/namei.h1
3 files changed, 3 insertions, 12 deletions
diff --git a/fs/namei.c b/fs/namei.c
index 52703986323a..3ed4d7576d6d 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -368,16 +368,6 @@ void path_release(struct nameidata *nd)
368 mntput(nd->mnt); 368 mntput(nd->mnt);
369} 369}
370 370
371/*
372 * umount() mustn't call path_release()/mntput() as that would clear
373 * mnt_expiry_mark
374 */
375void path_release_on_umount(struct nameidata *nd)
376{
377 dput(nd->dentry);
378 mntput_no_expire(nd->mnt);
379}
380
381/** 371/**
382 * release_open_intent - free up open intent resources 372 * release_open_intent - free up open intent resources
383 * @nd: pointer to nameidata 373 * @nd: pointer to nameidata
diff --git a/fs/namespace.c b/fs/namespace.c
index 63ced21c12dc..7937d30a6732 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -690,7 +690,9 @@ asmlinkage long sys_umount(char __user * name, int flags)
690 690
691 retval = do_umount(nd.mnt, flags); 691 retval = do_umount(nd.mnt, flags);
692dput_and_out: 692dput_and_out:
693 path_release_on_umount(&nd); 693 /* we mustn't call path_put() as that would clear mnt_expiry_mark */
694 dput(nd.dentry);
695 mntput_no_expire(nd.mnt);
694out: 696out:
695 return retval; 697 return retval;
696} 698}
diff --git a/include/linux/namei.h b/include/linux/namei.h
index c13e411491f4..307b1b31d37f 100644
--- a/include/linux/namei.h
+++ b/include/linux/namei.h
@@ -72,7 +72,6 @@ extern int path_lookup(const char *, unsigned, struct nameidata *);
72extern int vfs_path_lookup(struct dentry *, struct vfsmount *, 72extern int vfs_path_lookup(struct dentry *, struct vfsmount *,
73 const char *, unsigned int, struct nameidata *); 73 const char *, unsigned int, struct nameidata *);
74extern void path_release(struct nameidata *); 74extern void path_release(struct nameidata *);
75extern void path_release_on_umount(struct nameidata *);
76 75
77extern int __user_path_lookup_open(const char __user *, unsigned lookup_flags, struct nameidata *nd, int open_flags); 76extern int __user_path_lookup_open(const char __user *, unsigned lookup_flags, struct nameidata *nd, int open_flags);
78extern int path_lookup_open(int dfd, const char *name, unsigned lookup_flags, struct nameidata *, int open_flags); 77extern int path_lookup_open(int dfd, const char *name, unsigned lookup_flags, struct nameidata *, int open_flags);