Skip to content

Commit

Permalink
s390/dasd: prevent inconsistent LCU device data
Browse files Browse the repository at this point in the history
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.

Fixes: 8e09f21 ("[S390] dasd: add hyper PAV support to DASD device driver, part 1")
Cc: [email protected]
Signed-off-by: Stefan Haberland <[email protected]>
Reviewed-by: Jan Hoeppner <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
Stefan Haberland authored and axboe committed Dec 17, 2020
1 parent 658a337 commit a29ea01
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions drivers/s390/block/dasd_alias.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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;
}
Expand Down

0 comments on commit a29ea01

Please sign in to comment.