aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2014-10-08 13:42:57 -0400
committerEric W. Biederman <ebiederm@xmission.com>2014-12-02 11:46:51 -0500
commit4fed655c410cc56add64c7b1f7c85c7c56066ac2 (patch)
tree12a2492809350546bb88dce594248aa27c0f4730 /fs
parent381cacb12c009864993a072eedcc0720315aedbd (diff)
mnt: Clear mnt_expire during pivot_root
When inspecting the pivot_root and the current mount expiry logic I realized that pivot_root fails to clear like mount move does. Add the missing line in case someone does the interesting feat of moving an expirable submount. This gives a strong guarantee that root of the filesystem tree will never expire. Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/namespace.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/namespace.c b/fs/namespace.c
index f87a90b98da2..fe1c77145a78 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -2967,6 +2967,8 @@ SYSCALL_DEFINE2(pivot_root, const char __user *, new_root,
2967 /* mount new_root on / */ 2967 /* mount new_root on / */
2968 attach_mnt(new_mnt, real_mount(root_parent.mnt), root_mp); 2968 attach_mnt(new_mnt, real_mount(root_parent.mnt), root_mp);
2969 touch_mnt_namespace(current->nsproxy->mnt_ns); 2969 touch_mnt_namespace(current->nsproxy->mnt_ns);
2970 /* A moved mount should not expire automatically */
2971 list_del_init(&new_mnt->mnt_expire);
2970 unlock_mount_hash(); 2972 unlock_mount_hash();
2971 chroot_fs_refs(&root, &new); 2973 chroot_fs_refs(&root, &new);
2972 put_mountpoint(root_mp); 2974 put_mountpoint(root_mp);