linux/scripts/coccinelle/api
Kirill Smelkov 0c4ab18fc3 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/20190413170056.GA11293@deco.navytux.spb.ru/
	https://lore.kernel.org/linux-pci/20190415145456.GA15280@deco.navytux.spb.ru/
	https://lore.kernel.org/linux-pci/20190415154102.GB17661@deco.navytux.spb.ru/

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 <kirr@nexedi.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2019-07-08 02:25:59 +09:00
..
alloc dma-mapping: remove dma_zalloc_coherent() 2019-01-08 07:58:49 -05:00
debugfs License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
atomic_as_refcounter.cocci Coccinelle: add atomic_as_refcounter script 2018-07-18 01:18:05 +09:00
check_bq27xxx_data.cocci coccinelle: api: detect identical chip data arrays 2017-11-14 23:19:03 +09:00
d_find_alias.cocci License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
err_cast.cocci Coccinelle: Move err_cast.cocci to the api directory 2010-08-31 11:37:54 +02:00
kstrdup.cocci coccinelle: kstrdup: Fix typo in warning messages 2019-07-08 02:25:59 +09:00
memdup_user.cocci Coccinelle: limit memdup_user transformation to GFP_KERNEL case 2016-10-01 23:03:09 +02:00
memdup.cocci Coccinelle: memdup: Fix typo in warning messages 2018-03-03 00:41:24 +09:00
platform_no_drv_owner.cocci treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 257 2019-06-05 17:30:27 +02:00
pm_runtime.cocci Coccinelle: pm_runtime: ensure relevance of pm_runtime reports 2016-10-01 23:03:41 +02:00
ptr_ret.cocci scripts/coccinelle: Use PTR_ERR_OR_ZERO 2014-04-08 17:27:01 +02:00
resource_size.cocci Coccinelle: Move resource_size.cocci to the api directory 2010-08-31 11:37:54 +02:00
simple_open.cocci License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
stream_open.cocci coccinelle: api/stream_open: treat all wait_.*() calls as blocking 2019-07-08 02:25:59 +09:00
vma_pages.cocci License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00