diff options
author | Stefan Haberland <sth@linux.ibm.com> | 2020-12-17 16:59:07 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-12-30 11:54:09 +0100 |
commit | 983e7f3521f1442bc5629760b2008ebae676fcbc (patch) | |
tree | 7bc15f71aa8b9e5d48d53c117439668d103a5fb8 /drivers/s390/block/dasd_eckd.h | |
parent | 18494d12ef9b75fbec3a63e6376f452e7d0174c6 (diff) | |
download | linux-rt-983e7f3521f1442bc5629760b2008ebae676fcbc.tar.gz |
s390/dasd: fix list corruption of lcu list
commit 53a7f655834c7c335bf683f248208d4fbe4b47bc 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: 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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/s390/block/dasd_eckd.h')
0 files changed, 0 insertions, 0 deletions