linux-kernel-test/drivers/s390/cio
Alex Chiang 669420644c sysfs: only allow one scheduled removal callback per kobj
The only way for a sysfs attribute to remove itself (without
deadlock) is to use the sysfs_schedule_callback() interface.

Vegard Nossum discovered that a poorly written sysfs ->store
callback can repeatedly schedule remove callbacks on the same
device over and over, e.g.

	$ while true ; do echo 1 > /sys/devices/.../remove ; done

If the 'remove' attribute uses the sysfs_schedule_callback API
and also does not protect itself from concurrent accesses, its
callback handler will be called multiple times, and will
eventually attempt to perform operations on a freed kobject,
leading to many problems.

Instead of requiring all callers of sysfs_schedule_callback to
implement their own synchronization, provide the protection in
the infrastructure.

Now, sysfs_schedule_callback will only allow one scheduled
callback per kobject. On subsequent calls with the same kobject,
return -EAGAIN.

This is a short term fix. The long term fix is to allow sysfs
attributes to remove themselves directly, without any of this
callback hokey pokey.

[cornelia.huck@de.ibm.com: s390 ccwgroup bits]

Reported-by: vegard.nossum@gmail.com
Signed-off-by: Alex Chiang <achiang@hp.com>
Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-03-24 16:38:26 -07:00
..
airq.c [S390] cio: Allow adapter interrupt handlers per isc. 2008-07-14 10:02:10 +02:00
blacklist.c [S390] convert cio printks to pr_xxx macros. 2008-12-25 13:39:20 +01:00
blacklist.h [PATCH] s390: multiple subchannel sets support 2006-01-06 08:33:52 -08:00
ccwgroup.c sysfs: only allow one scheduled removal callback per kobj 2009-03-24 16:38:26 -07:00
chp.c [S390] bus_id -> dev_set_name() changes 2008-10-10 21:33:50 +02:00
chp.h [S390] cio: Repair chpid event handling. 2008-07-14 10:02:11 +02:00
chsc_sch.c Driver core: implement uevent suppress in kobject 2009-03-24 16:38:26 -07:00
chsc_sch.h [S390] cio: Add chsc subchannel driver. 2008-07-14 10:02:12 +02:00
chsc.c [S390] convert cio printks to pr_xxx macros. 2008-12-25 13:39:20 +01:00
chsc.h [S390] cio: Export chsc_error_from_response(). 2008-07-17 17:22:10 +02:00
cio_debug.h [S390] cio: Remove cio_msg kernel parameter. 2008-05-07 09:23:01 +02:00
cio.c fix similar typos to successfull 2009-01-08 08:31:15 -08:00
cio.h [S390] cio: introduce cio_commit_config 2008-12-25 13:39:10 +01:00
cmf.c [S390] convert cio printks to pr_xxx macros. 2008-12-25 13:39:20 +01:00
css.c Driver core: implement uevent suppress in kobject 2009-03-24 16:38:26 -07:00
css.h [S390] cio: Add chsc subchannel driver. 2008-07-14 10:02:12 +02:00
device_fsm.c [S390] cio: commit all pmcw changes. 2008-12-25 13:39:10 +01:00
device_id.c [S390] cio: provide functions for fcx enabled I/O 2008-07-14 10:02:08 +02:00
device_ops.c [S390] bus_id -> dev_name conversions 2008-10-10 21:33:49 +02:00
device_pgid.c [S390] cio: introduce cio_update_schib 2008-12-25 13:39:10 +01:00
device_status.c [S390] cio: introduce cio_update_schib 2008-12-25 13:39:10 +01:00
device.c Driver core: Fix device_move() vs. dpm list ordering, v2 2009-03-24 16:38:26 -07:00
device.h [S390] cio: introduce cio_commit_config 2008-12-25 13:39:10 +01:00
fcx.c [S390] cio: provide functions for fcx enabled I/O 2008-07-14 10:02:08 +02:00
idset.c [S390] cio: Memory allocation for idset changed. 2008-08-01 16:39:31 +02:00
idset.h [S390] cio: Add chsc subchannel driver. 2008-07-14 10:02:12 +02:00
io_sch.h [S390] cio: inline assembly cleanup 2008-10-10 21:33:53 +02:00
ioasm.h [S390] cio: inline assembly cleanup 2008-10-10 21:33:53 +02:00
isc.c [S390] cio: introduce isc_(un)register functions. 2008-07-14 10:02:11 +02:00
itcw.c [S390] cio: provide helper functions for fcx enabled I/O 2008-07-14 10:02:08 +02:00
Makefile [S390] qdio: new qdio driver. 2008-07-17 17:22:10 +02:00
qdio_debug.c [S390] qdio: fix broken pointer in case of CONFIG_DEBUG_FS is disabled 2009-01-09 12:15:07 +01:00
qdio_debug.h [S390] qdio: rework debug feature logging 2008-12-25 13:38:59 +01:00
qdio_main.c fix similar typos to successfull 2009-01-08 08:31:15 -08:00
qdio_perf.c [S390] qdio: improve inbound buffer acknowledgement 2008-12-25 13:38:59 +01:00
qdio_perf.h [S390] qdio: improve inbound buffer acknowledgement 2008-12-25 13:38:59 +01:00
qdio_setup.c [S390] qdio: fix error reporting for hipersockets 2008-12-25 13:39:00 +01:00
qdio_thinint.c [S390] qdio: improve inbound buffer acknowledgement 2008-12-25 13:38:59 +01:00
qdio.h [S390] qdio: fix error reporting for hipersockets 2008-12-25 13:39:00 +01:00
scsw.c [S390] cio: introduce fcx enabled scsw format 2008-07-14 10:02:07 +02:00