linux_old1/scripts/coccinelle
Nicolai Stange 5103068eac debugfs, coccinelle: check for obsolete DEFINE_SIMPLE_ATTRIBUTE() usage
In order to protect against file removal races, debugfs files created via
debugfs_create_file() now get wrapped by a struct file_operations at their
opening.

If the original struct file_operations are known to be safe against removal
races by themselves already, the proxy creation may be bypassed by creating
the files through debugfs_create_file_unsafe().

In order to help debugfs users who use the common
  DEFINE_SIMPLE_ATTRIBUTE() + debugfs_create_file()
idiom to transition to removal safe struct file_operations, the helper
macro DEFINE_DEBUGFS_ATTRIBUTE() has been introduced.

Thus, the preferred strategy is to use
  DEFINE_DEBUGFS_ATTRIBUTE() + debugfs_create_file_unsafe()
now.

Introduce a Coccinelle script that searches for
DEFINE_SIMPLE_ATTRIBUTE()-defined struct file_operations handed into
debugfs_create_file(). Suggest to turn these usages into the
  DEFINE_DEBUGFS_ATTRIBUTE() + debugfs_create_file_unsafe()
pattern.

Signed-off-by: Nicolai Stange <nicstange@gmail.com>
Acked-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-12 14:14:21 -07:00
..
api debugfs, coccinelle: check for obsolete DEFINE_SIMPLE_ATTRIBUTE() usage 2016-04-12 14:14:21 -07:00
free coccinelle: ifnullfree: handle various destroy functions 2015-10-26 22:41:18 +01:00
iterators scripts/coccinelle: modernize & 2016-02-18 11:49:30 +01:00
locks Coccinelle: Update the options used to the new option scheme 2013-07-03 22:58:13 +02:00
misc coccinelle: bugon: reduce rule applicability 2016-02-18 22:09:40 +01:00
null scripts/coccinelle: fix typos 2015-10-26 22:26:23 +01:00
tests coccinelle: tests: unsigned value cannot be lesser than zero 2016-01-12 17:47:47 +01:00