summaryrefslogtreecommitdiffstats
path: root/drivers/s390/cio/css.c
diff options
context:
space:
mode:
authorJan Höppner <hoeppner@linux.vnet.ibm.com>2016-10-13 13:31:39 +0200
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2016-10-28 10:09:04 +0200
commit9f9d53e5bdb4362a73b801176cae49e77bea41fb (patch)
tree6905495f3538632f731934c83f920eae671892ac /drivers/s390/cio/css.c
parent9de67725c80cb8a7b34b1932e196d2ed61a08879 (diff)
downloadlinux-stable-9f9d53e5bdb4362a73b801176cae49e77bea41fb.tar.gz
linux-stable-9f9d53e5bdb4362a73b801176cae49e77bea41fb.tar.bz2
linux-stable-9f9d53e5bdb4362a73b801176cae49e77bea41fb.zip
s390/dasd: Fix locking issue when changing RO attribute
The function dasd_ro_store() calls set_disk_ro() to set the device in question read-only. Since set_disk_ro() might sleep, we can't call it while holding a lock. However, we also can't simply check if the device, block, and gdp references are valid before we call set_disk_ro() because an offline processing might have been started in the meanwhile which will destroy those references. In order to reliably call set_disk_ro() we have to ensure several things: - Still check validity of the mentioned references but additionally check if offline processing is running and bail out accordingly. Also, do this while holding the device lock. - To ensure that the block device is still safe after the lock, increase the open_count while still holding the device 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/cio/css.c')
0 files changed, 0 insertions, 0 deletions