aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/namespace.c2
-rw-r--r--fs/super.c6
-rw-r--r--include/linux/fs.h1
3 files changed, 8 insertions, 1 deletions
diff --git a/fs/namespace.c b/fs/namespace.c
index 88058de59c7c..32dcd24bbc9a 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -1984,7 +1984,7 @@ long do_mount(char *dev_name, char *dir_name, char *type_page,
1984 if (flags & MS_RDONLY) 1984 if (flags & MS_RDONLY)
1985 mnt_flags |= MNT_READONLY; 1985 mnt_flags |= MNT_READONLY;
1986 1986
1987 flags &= ~(MS_NOSUID | MS_NOEXEC | MS_NODEV | MS_ACTIVE | 1987 flags &= ~(MS_NOSUID | MS_NOEXEC | MS_NODEV | MS_ACTIVE | MS_BORN |
1988 MS_NOATIME | MS_NODIRATIME | MS_RELATIME| MS_KERNMOUNT | 1988 MS_NOATIME | MS_NODIRATIME | MS_RELATIME| MS_KERNMOUNT |
1989 MS_STRICTATIME); 1989 MS_STRICTATIME);
1990 1990
diff --git a/fs/super.c b/fs/super.c
index 3479ca6f005f..bd9eea4bb2bb 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -305,8 +305,13 @@ retry:
305 if (s) { 305 if (s) {
306 up_write(&s->s_umount); 306 up_write(&s->s_umount);
307 destroy_super(s); 307 destroy_super(s);
308 s = NULL;
308 } 309 }
309 down_write(&old->s_umount); 310 down_write(&old->s_umount);
311 if (unlikely(!(old->s_flags & MS_BORN))) {
312 deactivate_locked_super(old);
313 goto retry;
314 }
310 return old; 315 return old;
311 } 316 }
312 } 317 }
@@ -918,6 +923,7 @@ vfs_kern_mount(struct file_system_type *type, int flags, const char *name, void
918 goto out_free_secdata; 923 goto out_free_secdata;
919 BUG_ON(!mnt->mnt_sb); 924 BUG_ON(!mnt->mnt_sb);
920 WARN_ON(!mnt->mnt_sb->s_bdi); 925 WARN_ON(!mnt->mnt_sb->s_bdi);
926 mnt->mnt_sb->s_flags |= MS_BORN;
921 927
922 error = security_sb_kern_mount(mnt->mnt_sb, flags, secdata); 928 error = security_sb_kern_mount(mnt->mnt_sb, flags, secdata);
923 if (error) 929 if (error)
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 9bedf4219f83..58e4b035e282 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -209,6 +209,7 @@ struct inodes_stat_t {
209#define MS_KERNMOUNT (1<<22) /* this is a kern_mount call */ 209#define MS_KERNMOUNT (1<<22) /* this is a kern_mount call */
210#define MS_I_VERSION (1<<23) /* Update inode I_version field */ 210#define MS_I_VERSION (1<<23) /* Update inode I_version field */
211#define MS_STRICTATIME (1<<24) /* Always perform atime updates */ 211#define MS_STRICTATIME (1<<24) /* Always perform atime updates */
212#define MS_BORN (1<<29)
212#define MS_ACTIVE (1<<30) 213#define MS_ACTIVE (1<<30)
213#define MS_NOUSER (1<<31) 214#define MS_NOUSER (1<<31)
214 215