1
0
Fork 0
alistair23-linux/drivers/s390/block
Stefan Haberland a7c256a9fd s390/dasd: fix list corruption of lcu list
commit 53a7f65583 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-12-30 11:51:34 +01:00
..
Kconfig s390/Kconfig: pedantic cleanups 2019-06-04 15:03:46 +02:00
Makefile
dasd.c s390/dasd: fix null pointer dereference for ERP requests 2020-11-24 13:29:23 +01:00
dasd_3990_erp.c
dasd_alias.c s390/dasd: fix list corruption of lcu list 2020-12-30 11:51:34 +01:00
dasd_devmap.c s390/dasd: Recognise data for ESE volumes 2019-07-11 20:39:53 +02:00
dasd_diag.c s390/dasd: fix inability to use DASD with DIAG driver 2020-08-19 08:16:29 +02:00
dasd_diag.h
dasd_eckd.c s390/dasd: fix data corruption for thin provisioned devices 2020-03-18 07:17:52 +01:00
dasd_eckd.h s390/dasd: Handle out-of-space constraint 2019-07-11 20:39:54 +02:00
dasd_eer.c s390/dasd: Handle out-of-space constraint 2019-07-11 20:39:54 +02:00
dasd_erp.c
dasd_fba.c s390/dasd: Fix zero write for FBA devices 2020-10-01 13:18:23 +02:00
dasd_fba.h s390/dasd: Make dasd_setup_queue() a discipline function 2019-07-11 20:39:54 +02:00
dasd_genhd.c block: genhd: add 'groups' argument to device_add_disk 2018-09-28 08:30:28 -06:00
dasd_int.h s390/dasd: fix data corruption for thin provisioned devices 2020-03-18 07:17:52 +01:00
dasd_ioctl.c s390/dasd: Add new ioctl to release space 2019-07-11 20:39:54 +02:00
dasd_proc.c s390/drivers: fix proc/debugfs file permissions 2018-12-13 10:42:24 +01:00
dcssblk.c libnvdimm: add dax_dev sync flag 2019-07-05 15:19:10 -07:00
scm_blk.c block: genhd: add 'groups' argument to device_add_disk 2018-09-28 08:30:28 -06:00
scm_blk.h
scm_drv.c
xpram.c