aboutsummaryrefslogtreecommitdiffstats
path: root/fs/namespace.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/namespace.c')
-rw-r--r--fs/namespace.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/fs/namespace.c b/fs/namespace.c
index 88058de59c7c..2e10cb19c5b0 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -29,6 +29,7 @@
29#include <linux/log2.h> 29#include <linux/log2.h>
30#include <linux/idr.h> 30#include <linux/idr.h>
31#include <linux/fs_struct.h> 31#include <linux/fs_struct.h>
32#include <linux/fsnotify.h>
32#include <asm/uaccess.h> 33#include <asm/uaccess.h>
33#include <asm/unistd.h> 34#include <asm/unistd.h>
34#include "pnode.h" 35#include "pnode.h"
@@ -150,6 +151,9 @@ struct vfsmount *alloc_vfsmnt(const char *name)
150 INIT_LIST_HEAD(&mnt->mnt_share); 151 INIT_LIST_HEAD(&mnt->mnt_share);
151 INIT_LIST_HEAD(&mnt->mnt_slave_list); 152 INIT_LIST_HEAD(&mnt->mnt_slave_list);
152 INIT_LIST_HEAD(&mnt->mnt_slave); 153 INIT_LIST_HEAD(&mnt->mnt_slave);
154#ifdef CONFIG_FSNOTIFY
155 INIT_HLIST_HEAD(&mnt->mnt_fsnotify_marks);
156#endif
153#ifdef CONFIG_SMP 157#ifdef CONFIG_SMP
154 mnt->mnt_writers = alloc_percpu(int); 158 mnt->mnt_writers = alloc_percpu(int);
155 if (!mnt->mnt_writers) 159 if (!mnt->mnt_writers)
@@ -610,6 +614,7 @@ static inline void __mntput(struct vfsmount *mnt)
610 * provides barriers, so count_mnt_writers() below is safe. AV 614 * provides barriers, so count_mnt_writers() below is safe. AV
611 */ 615 */
612 WARN_ON(count_mnt_writers(mnt)); 616 WARN_ON(count_mnt_writers(mnt));
617 fsnotify_vfsmount_delete(mnt);
613 dput(mnt->mnt_root); 618 dput(mnt->mnt_root);
614 free_vfsmnt(mnt); 619 free_vfsmnt(mnt);
615 deactivate_super(sb); 620 deactivate_super(sb);
@@ -783,7 +788,6 @@ static void show_mnt_opts(struct seq_file *m, struct vfsmount *mnt)
783 { MNT_NOATIME, ",noatime" }, 788 { MNT_NOATIME, ",noatime" },
784 { MNT_NODIRATIME, ",nodiratime" }, 789 { MNT_NODIRATIME, ",nodiratime" },
785 { MNT_RELATIME, ",relatime" }, 790 { MNT_RELATIME, ",relatime" },
786 { MNT_STRICTATIME, ",strictatime" },
787 { 0, NULL } 791 { 0, NULL }
788 }; 792 };
789 const struct proc_fs_info *fs_infop; 793 const struct proc_fs_info *fs_infop;
@@ -1984,7 +1988,7 @@ long do_mount(char *dev_name, char *dir_name, char *type_page,
1984 if (flags & MS_RDONLY) 1988 if (flags & MS_RDONLY)
1985 mnt_flags |= MNT_READONLY; 1989 mnt_flags |= MNT_READONLY;
1986 1990
1987 flags &= ~(MS_NOSUID | MS_NOEXEC | MS_NODEV | MS_ACTIVE | 1991 flags &= ~(MS_NOSUID | MS_NOEXEC | MS_NODEV | MS_ACTIVE | MS_BORN |
1988 MS_NOATIME | MS_NODIRATIME | MS_RELATIME| MS_KERNMOUNT | 1992 MS_NOATIME | MS_NODIRATIME | MS_RELATIME| MS_KERNMOUNT |
1989 MS_STRICTATIME); 1993 MS_STRICTATIME);
1990 1994
@@ -2208,10 +2212,7 @@ SYSCALL_DEFINE2(pivot_root, const char __user *, new_root,
2208 goto out1; 2212 goto out1;
2209 } 2213 }
2210 2214
2211 read_lock(&current->fs->lock); 2215 get_fs_root(current->fs, &root);
2212 root = current->fs->root;
2213 path_get(&current->fs->root);
2214 read_unlock(&current->fs->lock);
2215 down_write(&namespace_sem); 2216 down_write(&namespace_sem);
2216 mutex_lock(&old.dentry->d_inode->i_mutex); 2217 mutex_lock(&old.dentry->d_inode->i_mutex);
2217 error = -EINVAL; 2218 error = -EINVAL;