diff options
author | Roland Dreier <rolandd@cisco.com> | 2010-04-10 00:13:50 (GMT) |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2010-04-21 19:17:38 (GMT) |
commit | bc1db9af731a74c7eca04df5936214c800774113 (patch) | |
tree | 52ca4cf47e7eac41cc0f743d325ba1dfd0950350 /include/linux/timex.h | |
parent | 0eddb519b9127c73d53db4bf3ec1d45b13f844d1 (diff) | |
download | linux-fsl-qoriq-bc1db9af731a74c7eca04df5936214c800774113.tar.xz |
IB: Explicitly rule out llseek to avoid BKL in default_llseek()
Several RDMA user-access drivers have file_operations structures with
no .llseek method set. None of the drivers actually do anything with
f_pos, so this means llseek is essentially a NOP, instead of returning
an error as leaving other file_operations methods unimplemented would
do. This is mostly harmless, except that a NULL .llseek means that
default_llseek() is used, and this function grabs the BKL, which we
would like to avoid.
Since llseek does nothing useful on these files, we would like it to
return an error to userspace instead of silently grabbing the BKL and
succeeding. For nearly all of the file types, we take the
belt-and-suspenders approach of setting the .llseek method to
no_llseek and also calling nonseekable_open(); the exception is the
uverbs_event files, which are created with anon_inode_getfile(), which
already sets f_mode the same way as nonseekable_open() would.
This work is motivated by Arnd Bergmann's bkl-removal tree.
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'include/linux/timex.h')
0 files changed, 0 insertions, 0 deletions