FAILED: patch "[PATCH] s390/dasd: prevent inconsistent LCU device data" failed to apply to 4.4-stable tree
Subsystems (3)
[email protected]
maintainerThe patch below does not apply to the 4.4-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From a29ea01653493b94ea12bb2b89d1564a265081b6 Mon Sep 17 00:00:00 2001
From: Stefan Haberland <[email protected]>
Date: Thu, 17 Dec 2020 16:59:05 +0100
Subject: [PATCH] s390/dasd: prevent inconsistent LCU device data
Prevent _lcu_update from adding a device to a pavgroup if the LCU still requires an update. The data is not reliable any longer and in parallel devices might have been moved on the lists already.
This might lead to list corruptions or invalid PAV grouping. Only add devices to a pavgroup if the LCU is up to date. Additional steps are taken by the scheduled lcu update.
drivers/s390/block/dasd_alias.c +9 -0
@@ -511,6 +511,14 @@ static int _lcu_update(struct dasd_device *refdev, struct alias_lcu *lcu)return rc;spin_lock_irqsave (&lcu->lock, flags); +/* +* there is another update needed skip the remaining handling +* the data might already be outdated +* but especially do not add the device to an LCU with pending +* update +*/ +if (lcu->flags &NEED_UAC_UPDATE ) + goto out; lcu->pav =NO_PAV ;for (i =0 ; i <MAX_DEVICES_PER_LCU ; ++i) {switch (lcu->uac->unit[i].ua_type) {
@@ -529,6 +537,7 @@ static int _lcu_update(struct dasd_device *refdev, struct alias_lcu *lcu) alias_list) {_add_device_to_lcu (lcu, device, refdev); } +out:spin_unlock_irqrestore (&lcu->lock, flags);return 0 ; }