1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00
linux/drivers/s390
Stefan Haberland 53a7f65583 s390/dasd: fix list corruption of lcu list
In dasd_alias_disconnect_device_from_lcu the device is removed from any
list on the LCU. Afterwards the LCU is removed from the lcu list if it
does not contain devices any longer.

The lcu->lock protects the lcu from parallel updates. But to cancel all
workers and wait for completion the lcu->lock has to be unlocked.

If two devices are removed in parallel and both are removed from the LCU
the first device that takes the lcu->lock again will delete the LCU because
it is already empty but the second device also tries to free the LCU which
leads to a list corruption of the lcu list.

Fix by removing the device right before the lcu is checked without
unlocking the lcu->lock in between.

Fixes: 8e09f21574 ("[S390] dasd: add hyper PAV support to DASD device driver, part 1")
Cc: stable@vger.kernel.org
Signed-off-by: Stefan Haberland <sth@linux.ibm.com>
Reviewed-by: Jan Hoeppner <hoeppner@linux.ibm.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-12-17 13:41:30 -07:00
..
block s390/dasd: fix list corruption of lcu list 2020-12-17 13:41:30 -07:00
char s390/vmur: remove unused pm related functions 2020-12-02 18:19:24 +01:00
cio for-5.11/drivers-2020-12-14 2020-12-16 13:09:32 -08:00
crypto s390/ap: let bus_register() add the AP bus sysfs attributes 2020-11-30 14:10:50 +01:00
net s390/qeth: make qeth_qdio_handle_aob() more robust 2020-12-07 06:55:21 -08:00
scsi SCSI misc on 20201216 2020-12-16 13:34:31 -08:00
virtio s390/virtio: remove unused pm callbacks 2020-06-16 13:44:04 +02:00
Makefile s390: remove pointless drivers-y in drivers/s390/Makefile 2019-09-16 13:21:51 +02:00