diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2016-06-09 15:44:48 -0500 |
---|---|---|
committer | Eric W. Biederman <ebiederm@xmission.com> | 2016-06-23 15:47:31 -0500 |
commit | cc50a07a247e17db76b1f0b0ca06652556e04fa3 (patch) | |
tree | 64060a2d84ef06285de1f1a13008899dec16a2dc /fs | |
parent | 67690f937c38bbab1d94cb45f6a32e61612834ae (diff) | |
download | linux-cc50a07a247e17db76b1f0b0ca06652556e04fa3.tar.gz linux-cc50a07a247e17db76b1f0b0ca06652556e04fa3.tar.bz2 linux-cc50a07a247e17db76b1f0b0ca06652556e04fa3.zip |
userns: Remove the now unnecessary FS_USERNS_DEV_MOUNT flag
Now that SB_I_NODEV controls the nodev behavior devpts can just clear
this flag during mount. Simplifying the code and making it easier
to audit how the code works. While still preserving the invariant
that s_iflags is only modified during mount.
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/devpts/inode.c | 3 | ||||
-rw-r--r-- | fs/super.c | 3 |
2 files changed, 3 insertions, 3 deletions
diff --git a/fs/devpts/inode.c b/fs/devpts/inode.c index 37c134a132c7..d116453b0276 100644 --- a/fs/devpts/inode.c +++ b/fs/devpts/inode.c @@ -396,6 +396,7 @@ devpts_fill_super(struct super_block *s, void *data, int silent) { struct inode *inode; + s->s_iflags &= ~SB_I_NODEV; s->s_blocksize = 1024; s->s_blocksize_bits = 10; s->s_magic = DEVPTS_SUPER_MAGIC; @@ -480,7 +481,7 @@ static struct file_system_type devpts_fs_type = { .name = "devpts", .mount = devpts_mount, .kill_sb = devpts_kill_sb, - .fs_flags = FS_USERNS_MOUNT | FS_USERNS_DEV_MOUNT, + .fs_flags = FS_USERNS_MOUNT, }; /* diff --git a/fs/super.c b/fs/super.c index 25cdceed2ad3..37813bf479cf 100644 --- a/fs/super.c +++ b/fs/super.c @@ -206,8 +206,7 @@ static struct super_block *alloc_super(struct file_system_type *type, int flags, init_waitqueue_head(&s->s_writers.wait_unfrozen); s->s_bdi = &noop_backing_dev_info; s->s_flags = flags; - if ((s->s_user_ns != &init_user_ns) && - !(type->fs_flags & FS_USERNS_DEV_MOUNT)) + if (s->s_user_ns != &init_user_ns) s->s_iflags |= SB_I_NODEV; INIT_HLIST_NODE(&s->s_instances); INIT_HLIST_BL_HEAD(&s->s_anon); |