]> git.baikalelectronics.ru Git - kernel.git/commit
autofs: improve ioctl sbi checks
authorIan Kent <raven@themaw.net>
Thu, 3 Jan 2019 23:27:33 +0000 (15:27 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 4 Jan 2019 21:13:46 +0000 (13:13 -0800)
commit463f895993b385879b2617ff613327ac442c66eb
tree9a15cf912445e21d9ad3fb87f087a89185313191
parent61b852c2d1e49d1fb0e9f0e66e6d7e14aa0e4974
autofs: improve ioctl sbi checks

Al Viro made some suggestions to improve the implementation of commit
a5c97a5df0 ("fix autofs_sbi() does not check super block type").

The check is unnecessary in all cases except for ioctl usage so placing
the check in the super block accessor function adds a small overhead to
the common case where it isn't needed.

So it's sufficient to do this in the ioctl code only.

Also the check in the ioctl code is needlessly complex.

[akpm@linux-foundation.org: declare autofs_fs_type in .h, not .c]
Link: http://lkml.kernel.org/r/154296970987.9889.1597442413573683096.stgit@pluto-themaw-net
Signed-off-by: Ian Kent <raven@themaw.net>
Cc: Al Viro <viro@ZenIV.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/autofs/autofs_i.h
fs/autofs/dev-ioctl.c
fs/autofs/init.c