From d5482cca74f60674fb13e153af503004f3851f64 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Mon, 9 Aug 2010 12:05:43 -0400 Subject: [PATCH] --- yaml --- r: 207600 b: refs/heads/master c: 7a4dec53897ecd3367efb1e12fe8a4edc47dc0e9 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/namespace.c | 2 +- trunk/fs/super.c | 6 ++++++ trunk/include/linux/fs.h | 1 + 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 077ff48580da..adb3b7f16386 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 4f331f01b9c43bf001d3ffee578a97a1e0633eac +refs/heads/master: 7a4dec53897ecd3367efb1e12fe8a4edc47dc0e9 diff --git a/trunk/fs/namespace.c b/trunk/fs/namespace.c index 88058de59c7c..32dcd24bbc9a 100644 --- a/trunk/fs/namespace.c +++ b/trunk/fs/namespace.c @@ -1984,7 +1984,7 @@ long do_mount(char *dev_name, char *dir_name, char *type_page, if (flags & MS_RDONLY) mnt_flags |= MNT_READONLY; - flags &= ~(MS_NOSUID | MS_NOEXEC | MS_NODEV | MS_ACTIVE | + flags &= ~(MS_NOSUID | MS_NOEXEC | MS_NODEV | MS_ACTIVE | MS_BORN | MS_NOATIME | MS_NODIRATIME | MS_RELATIME| MS_KERNMOUNT | MS_STRICTATIME); diff --git a/trunk/fs/super.c b/trunk/fs/super.c index 3479ca6f005f..bd9eea4bb2bb 100644 --- a/trunk/fs/super.c +++ b/trunk/fs/super.c @@ -305,8 +305,13 @@ struct super_block *sget(struct file_system_type *type, if (s) { up_write(&s->s_umount); destroy_super(s); + s = NULL; } down_write(&old->s_umount); + if (unlikely(!(old->s_flags & MS_BORN))) { + deactivate_locked_super(old); + goto retry; + } return old; } } @@ -918,6 +923,7 @@ vfs_kern_mount(struct file_system_type *type, int flags, const char *name, void goto out_free_secdata; BUG_ON(!mnt->mnt_sb); WARN_ON(!mnt->mnt_sb->s_bdi); + mnt->mnt_sb->s_flags |= MS_BORN; error = security_sb_kern_mount(mnt->mnt_sb, flags, secdata); if (error) diff --git a/trunk/include/linux/fs.h b/trunk/include/linux/fs.h index 9bedf4219f83..58e4b035e282 100644 --- a/trunk/include/linux/fs.h +++ b/trunk/include/linux/fs.h @@ -209,6 +209,7 @@ struct inodes_stat_t { #define MS_KERNMOUNT (1<<22) /* this is a kern_mount call */ #define MS_I_VERSION (1<<23) /* Update inode I_version field */ #define MS_STRICTATIME (1<<24) /* Always perform atime updates */ +#define MS_BORN (1<<29) #define MS_ACTIVE (1<<30) #define MS_NOUSER (1<<31)