aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/namespace.c39
1 files changed, 16 insertions, 23 deletions
diff --git a/fs/namespace.c b/fs/namespace.c
index 3ee6e59ead55..691cd7c83275 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -872,28 +872,6 @@ static struct mount *clone_mnt(struct mount *old, struct dentry *root,
872 return ERR_PTR(err); 872 return ERR_PTR(err);
873} 873}
874 874
875static inline void mntfree(struct mount *mnt)
876{
877 struct vfsmount *m = &mnt->mnt;
878 struct super_block *sb = m->mnt_sb;
879
880 /*
881 * This probably indicates that somebody messed
882 * up a mnt_want/drop_write() pair. If this
883 * happens, the filesystem was probably unable
884 * to make r/w->r/o transitions.
885 */
886 /*
887 * The locking used to deal with mnt_count decrement provides barriers,
888 * so mnt_get_writers() below is safe.
889 */
890 WARN_ON(mnt_get_writers(mnt));
891 fsnotify_vfsmount_delete(m);
892 dput(m->mnt_root);
893 free_vfsmnt(mnt);
894 deactivate_super(sb);
895}
896
897static void mntput_no_expire(struct mount *mnt) 875static void mntput_no_expire(struct mount *mnt)
898{ 876{
899put_again: 877put_again:
@@ -929,7 +907,22 @@ put_again:
929 907
930 list_del(&mnt->mnt_instance); 908 list_del(&mnt->mnt_instance);
931 br_write_unlock(&vfsmount_lock); 909 br_write_unlock(&vfsmount_lock);
932 mntfree(mnt); 910
911 /*
912 * This probably indicates that somebody messed
913 * up a mnt_want/drop_write() pair. If this
914 * happens, the filesystem was probably unable
915 * to make r/w->r/o transitions.
916 */
917 /*
918 * The locking used to deal with mnt_count decrement provides barriers,
919 * so mnt_get_writers() below is safe.
920 */
921 WARN_ON(mnt_get_writers(mnt));
922 fsnotify_vfsmount_delete(&mnt->mnt);
923 dput(mnt->mnt.mnt_root);
924 deactivate_super(mnt->mnt.mnt_sb);
925 free_vfsmnt(mnt);
933} 926}
934 927
935void mntput(struct vfsmount *mnt) 928void mntput(struct vfsmount *mnt)