diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2016-06-09 17:06:06 -0400 |
---|---|---|
committer | Eric W. Biederman <ebiederm@xmission.com> | 2016-06-23 16:41:46 -0400 |
commit | 8654df4e2ac9704905198d63845554c2ddf6a93f (patch) | |
tree | 80c18b034fecf8e5754945f9e31ad2a807386907 /include/linux/fs.h | |
parent | 695e9df010e40f407f4830dc11d53dce957710ba (diff) |
mnt: Refactor fs_fully_visible into mount_too_revealing
Replace the call of fs_fully_visible in do_new_mount from before the
new superblock is allocated with a call of mount_too_revealing after
the superblock is allocated. This winds up being a much better location
for maintainability of the code.
The first change this enables is the replacement of FS_USERNS_VISIBLE
with SB_I_USERNS_VISIBLE. Moving the flag from struct filesystem_type
to sb_iflags on the superblock.
Unfortunately mount_too_revealing fundamentally needs to touch
mnt_flags adding several MNT_LOCKED_XXX flags at the appropriate
times. If the mnt_flags did not need to be touched the code
could be easily moved into the filesystem specific mount code.
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Diffstat (limited to 'include/linux/fs.h')
-rw-r--r-- | include/linux/fs.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index dd288148a6b1..71988dd3af95 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -1328,6 +1328,9 @@ struct mm_struct; | |||
1328 | #define SB_I_CGROUPWB 0x00000001 /* cgroup-aware writeback enabled */ | 1328 | #define SB_I_CGROUPWB 0x00000001 /* cgroup-aware writeback enabled */ |
1329 | #define SB_I_NOEXEC 0x00000002 /* Ignore executables on this fs */ | 1329 | #define SB_I_NOEXEC 0x00000002 /* Ignore executables on this fs */ |
1330 | 1330 | ||
1331 | /* sb->s_iflags to limit user namespace mounts */ | ||
1332 | #define SB_I_USERNS_VISIBLE 0x00000010 /* fstype already mounted */ | ||
1333 | |||
1331 | /* Possible states of 'frozen' field */ | 1334 | /* Possible states of 'frozen' field */ |
1332 | enum { | 1335 | enum { |
1333 | SB_UNFROZEN = 0, /* FS is unfrozen */ | 1336 | SB_UNFROZEN = 0, /* FS is unfrozen */ |
@@ -2011,7 +2014,6 @@ struct file_system_type { | |||
2011 | #define FS_HAS_SUBTYPE 4 | 2014 | #define FS_HAS_SUBTYPE 4 |
2012 | #define FS_USERNS_MOUNT 8 /* Can be mounted by userns root */ | 2015 | #define FS_USERNS_MOUNT 8 /* Can be mounted by userns root */ |
2013 | #define FS_USERNS_DEV_MOUNT 16 /* A userns mount does not imply MNT_NODEV */ | 2016 | #define FS_USERNS_DEV_MOUNT 16 /* A userns mount does not imply MNT_NODEV */ |
2014 | #define FS_USERNS_VISIBLE 32 /* FS must already be visible */ | ||
2015 | #define FS_RENAME_DOES_D_MOVE 32768 /* FS will handle d_move() during rename() internally. */ | 2017 | #define FS_RENAME_DOES_D_MOVE 32768 /* FS will handle d_move() during rename() internally. */ |
2016 | struct dentry *(*mount) (struct file_system_type *, int, | 2018 | struct dentry *(*mount) (struct file_system_type *, int, |
2017 | const char *, void *); | 2019 | const char *, void *); |