Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

s390/dasd: prevent prefix I/O error

Prevent that a prefix flag is set based on invalid configuration data.
The validity.verify_base flag should only be set for alias devices.
Usually the unit address type is either one of base, PAV alias or
HyperPAV alias. But in cases where the unit address type is not set or
any other value the validity.verify_base flag might be set as well.
This would lead to follow on errors.
Explicitly check for alias devices and set the validity flag only for
them.

Signed-off-by: Stefan Haberland <sth@linux.vnet.ibm.com>
Reviewed-by: Jan Hoeppner <hoeppner@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>

authored by

Stefan Haberland and committed by
Martin Schwidefsky
da340f92 fbbd7f1a

+10 -6
+10 -6
drivers/s390/block/dasd_eckd.c
··· 531 531 pfxdata->validity.define_extent = 1; 532 532 533 533 /* private uid is kept up to date, conf_data may be outdated */ 534 - if (startpriv->uid.type != UA_BASE_DEVICE) { 534 + if (startpriv->uid.type == UA_BASE_PAV_ALIAS) 535 535 pfxdata->validity.verify_base = 1; 536 - if (startpriv->uid.type == UA_HYPER_PAV_ALIAS) 537 - pfxdata->validity.hyper_pav = 1; 536 + 537 + if (startpriv->uid.type == UA_HYPER_PAV_ALIAS) { 538 + pfxdata->validity.verify_base = 1; 539 + pfxdata->validity.hyper_pav = 1; 538 540 } 539 541 540 542 rc = define_extent(NULL, dedata, trk, totrk, cmd, basedev, blksize); ··· 3417 3415 pfxdata.validity.define_extent = 1; 3418 3416 3419 3417 /* private uid is kept up to date, conf_data may be outdated */ 3420 - if (startpriv->uid.type != UA_BASE_DEVICE) { 3418 + if (startpriv->uid.type == UA_BASE_PAV_ALIAS) 3421 3419 pfxdata.validity.verify_base = 1; 3422 - if (startpriv->uid.type == UA_HYPER_PAV_ALIAS) 3423 - pfxdata.validity.hyper_pav = 1; 3420 + 3421 + if (startpriv->uid.type == UA_HYPER_PAV_ALIAS) { 3422 + pfxdata.validity.verify_base = 1; 3423 + pfxdata.validity.hyper_pav = 1; 3424 3424 } 3425 3425 3426 3426 switch (cmd) {