]> git.baikalelectronics.ru Git - kernel.git/commit
vfs: Generalize filesystem nodev handling.
authorEric W. Biederman <ebiederm@xmission.com>
Thu, 9 Jun 2016 20:34:02 +0000 (15:34 -0500)
committerEric W. Biederman <ebiederm@xmission.com>
Thu, 23 Jun 2016 20:41:57 +0000 (15:41 -0500)
commit1bb39dcdd8bf210480e91ada54a5d987de9fb47f
tree61ccc6ad01f8804d5290ae4565ba8d4238bf648a
parentb4cbdcd9016133049bdb875e84865bf44c75bb17
vfs: Generalize filesystem nodev handling.

Introduce a function may_open_dev that tests MNT_NODEV and a new
superblock flab SB_I_NODEV.  Use this new function in all of the
places where MNT_NODEV was previously tested.

Add the new SB_I_NODEV s_iflag to proc, sysfs, and mqueuefs as those
filesystems should never support device nodes, and a simple superblock
flags makes that very hard to get wrong.  With SB_I_NODEV set if any
device nodes somehow manage to show up on on a filesystem those
device nodes will be unopenable.

Acked-by: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
fs/block_dev.c
fs/kernfs/mount.c
fs/namei.c
fs/proc/inode.c
include/linux/fs.h
ipc/mqueue.c