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: 8e09f21574ea ("[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
..
2020-12-15 16:39:06 -08:00
2020-12-16 12:07:54 -08:00
2020-12-15 16:30:31 -08:00
2020-12-15 15:24:52 +01:00
2020-12-15 13:22:29 -08:00
2020-12-07 10:08:14 +01:00
2020-12-15 16:06:14 -08:00
2020-12-15 22:46:18 -08:00
2020-12-16 11:49:46 -08:00
2020-12-15 16:30:31 -08:00
2020-12-16 12:57:51 -08:00
2020-12-03 10:00:23 +01:00
2020-12-16 13:09:32 -08:00
2020-12-16 13:34:31 -08:00
2020-12-15 15:57:25 -08:00
2020-12-16 12:57:51 -08:00
2020-12-16 11:53:09 -08:00
2020-12-15 13:22:29 -08:00
2020-12-16 13:42:26 -08:00
2020-12-15 14:02:26 -08:00
2020-12-15 15:24:52 +01:00
2020-12-16 13:42:26 -08:00
2020-12-16 13:34:31 -08:00
2020-12-15 16:30:31 -08:00
2020-12-10 10:45:36 +01:00
2020-12-16 13:34:31 -08:00
2020-12-16 10:45:11 -08:00
2020-12-16 12:57:51 -08:00
2020-12-15 12:13:37 -08:00
2020-12-14 11:07:56 -08:00
2020-12-09 19:44:34 +01:00
2020-12-16 11:53:09 -08:00