diff options
author | Kirill Smelkov <[email protected]> | 2019-06-23 07:28:53 +0000 |
---|---|---|
committer | Masahiro Yamada <[email protected]> | 2019-07-08 02:25:59 +0900 |
commit | 0c4ab18fc33bba70299f51fac83e32397cf9a04b (patch) | |
tree | 5be658bb4f5ec66d531fc68eb380c4601faa0abc /scripts/gen_compile_commands.py | |
parent | f58c17c202e7aec9623754a7ec0b0669e043b838 (diff) |
coccinelle: api/stream_open: treat all wait_.*() calls as blocking
Previously steam_open.cocci was treating only wait_event_.* - e.g.
wait_event_interruptible - as a blocking operation. However e.g.
wait_for_completion_interruptible is also blocking, and so from this
point of view it would be more logical to treat all wait_.* as a
blocking point.
The logic of this change actually came up for real when
drivers/pci/switch/switchtec.c changed from using
wait_event_interruptible to wait_for_completion_interruptible:
https://lore.kernel.org/linux-pci/[email protected]/
https://lore.kernel.org/linux-pci/[email protected]/
https://lore.kernel.org/linux-pci/[email protected]/
For a driver that uses nonseekable_open with read/write having stream
semantic and read also calling e.g. wait_for_completion_interruptible,
running stream_open.cocci before this patch would produce:
WARNING: <driver>_fops: .read() and .write() have stream semantic; safe to change nonseekable_open -> stream_open.
while after this patch it will report:
ERROR: <driver>_fops: .read() can deadlock .write(); change nonseekable_open -> stream_open to fix.
Signed-off-by: Kirill Smelkov <[email protected]>
Acked-by: Julia Lawall <[email protected]>
Signed-off-by: Masahiro Yamada <[email protected]>
Diffstat (limited to 'scripts/gen_compile_commands.py')
0 files changed, 0 insertions, 0 deletions