]> 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)
commit6e5c2ab72987ff1fd14dc0a04e12f57eecc60080
tree9a15cf912445e21d9ad3fb87f087a89185313191
parent51979061b3ca3005de9b2c8bd4e4c75aef960bdb
autofs: improve ioctl sbi checks

Al Viro made some suggestions to improve the implementation of commit
3aa60e2f25 ("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