linux/drivers/s390
Jan Höppner 0f57c97f24 s390/dasd: Eliminate race condition in dasd_generic_set_offline()
Before we set a device offline, the open_count for the block device is
checked and certain flags are checked and set as well.
However, this is all done without holding any lock. Potentially, if the
open_count was checked but the DASD_FLAG_OFFLINE wasn't set yet, a
different process might want to increase the open_count depending on
whether DASD_FLAG_OFFLINE is set or not in the meanwhile.

This is quite racy and can lead to the loss of the device for that
process and subsequently lead to a panic.

Fix this by checking the open_count and setting the offline flags while
holding the ccwdev lock.

Reviewed-by: Stefan Haberland <sth@linux.vnet.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2016-10-28 10:09:04 +02:00
..
block s390/dasd: Eliminate race condition in dasd_generic_set_offline() 2016-10-28 10:09:04 +02:00
char Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux 2016-10-04 14:05:52 -07:00
cio s390/cio: clean up DEV_STATE_SENSE_PGID 2016-10-28 10:09:03 +02:00
crypto s390/zcrypt: fix possible memory leak in ap_module_init() 2016-07-31 06:10:41 -04:00
net s390/qeth: fix setting VIPA address 2016-09-16 04:29:14 -04:00
scsi scsi: zfcp: spin_lock_irqsave() is not nestable 2016-10-14 16:21:08 -04:00
virtio virtio/s390: deprecate old transport 2016-08-09 13:42:41 +03:00
Makefile virtio/s390: rename drivers/s390/kvm -> drivers/s390/virtio 2015-07-07 14:27:06 +03:00