From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-sn1nam02on0104.outbound.protection.outlook.com ([104.47.36.104]:45334 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1032282AbeCAPhE (ORCPT ); Thu, 1 Mar 2018 10:37:04 -0500 From: Sasha Levin To: "stable@vger.kernel.org" , "stable-commits@vger.kernel.org" CC: Stefan Haberland , Martin Schwidefsky , Sasha Levin Subject: [added to the 4.1 stable tree] s390/dasd: prevent prefix I/O error Date: Thu, 1 Mar 2018 15:26:55 +0000 Message-ID: <20180301152116.1486-413-alexander.levin@microsoft.com> References: <20180301152116.1486-1-alexander.levin@microsoft.com> In-Reply-To: <20180301152116.1486-1-alexander.levin@microsoft.com> Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org List-ID: From: Stefan Haberland This patch has been added to the 4.1 stable tree. If you have any objections, please let us know. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D [ Upstream commit da340f921d3454f1521671c7a5a43ad3331fbe50 ] 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 Reviewed-by: Jan Hoeppner Signed-off-by: Martin Schwidefsky Signed-off-by: Sasha Levin --- drivers/s390/block/dasd_eckd.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/drivers/s390/block/dasd_eckd.c b/drivers/s390/block/dasd_eckd.= c index 6215f6455eb8..7f31087fca31 100644 --- a/drivers/s390/block/dasd_eckd.c +++ b/drivers/s390/block/dasd_eckd.c @@ -518,10 +518,12 @@ static int prefix_LRE(struct ccw1 *ccw, struct PFX_ec= kd_data *pfxdata, pfxdata->validity.define_extent =3D 1; =20 /* private uid is kept up to date, conf_data may be outdated */ - if (startpriv->uid.type !=3D UA_BASE_DEVICE) { + if (startpriv->uid.type =3D=3D UA_BASE_PAV_ALIAS) pfxdata->validity.verify_base =3D 1; - if (startpriv->uid.type =3D=3D UA_HYPER_PAV_ALIAS) - pfxdata->validity.hyper_pav =3D 1; + + if (startpriv->uid.type =3D=3D UA_HYPER_PAV_ALIAS) { + pfxdata->validity.verify_base =3D 1; + pfxdata->validity.hyper_pav =3D 1; } =20 /* define extend data (mostly)*/ @@ -2964,10 +2966,12 @@ static int prepare_itcw(struct itcw *itcw, pfxdata.validity.define_extent =3D 1; =20 /* private uid is kept up to date, conf_data may be outdated */ - if (startpriv->uid.type !=3D UA_BASE_DEVICE) { + if (startpriv->uid.type =3D=3D UA_BASE_PAV_ALIAS) + pfxdata.validity.verify_base =3D 1; + + if (startpriv->uid.type =3D=3D UA_HYPER_PAV_ALIAS) { pfxdata.validity.verify_base =3D 1; - if (startpriv->uid.type =3D=3D UA_HYPER_PAV_ALIAS) - pfxdata.validity.hyper_pav =3D 1; + pfxdata.validity.hyper_pav =3D 1; } =20 switch (cmd) { --=20 2.14.1