summaryrefslogtreecommitdiffstats
path: root/drivers/s390/block/dasd_eer.c
diff options
context:
space:
mode:
authorJan Höppner <hoeppner@linux.vnet.ibm.com>2016-10-18 17:54:49 +0200
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2016-10-28 10:09:04 +0200
commit0f57c97f241b4fc18251fb2b1c499e9f71e93c78 (patch)
treed4a852d838aa62ad6fc28ce183730646b8bbc3c3 /drivers/s390/block/dasd_eer.c
parents390/dasd: Make use of dasd_set_feature() more often (diff)
downloadlinux-0f57c97f241b4fc18251fb2b1c499e9f71e93c78.tar.xz
linux-0f57c97f241b4fc18251fb2b1c499e9f71e93c78.zip
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>
Diffstat (limited to 'drivers/s390/block/dasd_eer.c')
0 files changed, 0 insertions, 0 deletions