Received: by 10.213.65.68 with SMTP id h4csp2113393imn; Sun, 8 Apr 2018 20:03:24 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+1aXypDbcX6IBC69MYK8PSYLeWuNBHt/V96mT8ERgAou3uTrMt34pSh0LB9xh6TzPfQvV1 X-Received: by 2002:a17:902:887:: with SMTP id 7-v6mr37453360pll.319.1523243004121; Sun, 08 Apr 2018 20:03:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523243004; cv=none; d=google.com; s=arc-20160816; b=vA/Ma95VLsL1ud6wr4OrpUTWUNJMcryQvJ//VJecmotni+ozWZQyK3Iz3QJOBBSV0x cvH9MHv1qXouzI0yEImep5uYaCEIfg5YmU9I+Jc2+PlxNMAgnAUi/vooBABulpcqDY0f 6vFAxggc7P+wzAQyBSdA8kdJIe5+dnkyiohGXEJCqwJS0iBJ1SvBFyjgn7sG/UZzT2jQ cqfiaN79rN94Gd+UOggOySiv9xY+2PzLHw0svorxrDccL8pblmQUaynOMp59GzO+wG3Q u1j+MAooQpuJLJzCRsJKAMfdXK/MNoI/VcWKFHPkSzJa38D4oXOuWo+GBZ/GeY93cpJI 9isQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=33F7UhTrLa64sWgI74z8jthpFO+4mb6hizAoLESI2Lg=; b=cJ+h2RnAxyOUQKQdawxiPG5yIsNsSp7meikpKxwLKOHNAnh61T3AXL7reAv4cuEBE+ kBKWNDNkFqdqiv0zsXCa5U/XuOqkFEvzKG534pCjXC6aPepkBjj38YYdv0beQaUfysQx ZHGRNz1/IctqUvGYmxvjW+QRkygBkRKhwq3pekFlW2L9plGfpt6oz4fbnS/8t9M/Xv+B jAbYmlozKLGNZpE8uAcx+p7FXxqm0ztSdWeTHfrTYp5yMPb2YHPFgHO7oa2DIOaCSCAa f/yxUU4Enp694GTQwibDo2YRq58e5vlsusteBdM88xEh+KPoovFGV8nc+o1UgeLYMY6H UStA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=lJcKo9LD; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b96-v6si13759294pli.407.2018.04.08.20.02.46; Sun, 08 Apr 2018 20:03:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=lJcKo9LD; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755650AbeDIA1i (ORCPT + 99 others); Sun, 8 Apr 2018 20:27:38 -0400 Received: from mail-cys01nam02on0094.outbound.protection.outlook.com ([104.47.37.94]:22752 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755602AbeDIA1b (ORCPT ); Sun, 8 Apr 2018 20:27:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=33F7UhTrLa64sWgI74z8jthpFO+4mb6hizAoLESI2Lg=; b=lJcKo9LDqoz00DEYckReHHSwLLRxGynYKUh7SuecXEYsiJVb/apB02Lf0xcQKj4aO9ndeL8J/eRvPWEpu4f/0lHdBTb3eoA5bLpFeqqhFlKhAJpQI9AJP04nDojtkBynlWUgWNNoz9w3qhJ6RkXuDG2NuJETFMWFEcWLNw0+uAk= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB1031.namprd21.prod.outlook.com (52.132.128.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.696.0; Mon, 9 Apr 2018 00:27:25 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059%2]) with mapi id 15.20.0696.003; Mon, 9 Apr 2018 00:27:25 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Stefan Haberland , Martin Schwidefsky , Sasha Levin Subject: [PATCH AUTOSEL for 4.9 044/293] s390/dasd: fix hanging safe offline Thread-Topic: [PATCH AUTOSEL for 4.9 044/293] s390/dasd: fix hanging safe offline Thread-Index: AQHTz5j4baBCat6xFkGW1ax+rBeeAw== Date: Mon, 9 Apr 2018 00:23:24 +0000 Message-ID: <20180409002239.163177-44-alexander.levin@microsoft.com> References: <20180409002239.163177-1-alexander.levin@microsoft.com> In-Reply-To: <20180409002239.163177-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR2101MB1031;7:KpfXdopvo3HhHz/SXEQJbq0SsxxM1sZWC0hAZOl25Z+lt8n5OcPED1BZHYVan6d7HP8gl2S+DQP0jmV4Wkp9DC7JFbbOGz1hIiHAVSnwbL5xx9WQgfUiub6rsGWE9jocBhFuH202D45k465W1nAuu++WaCCuj8ju6WquuHfic6dpVq5LeHLFliE3B2acuSx3p/xFxTh4yMYcx+bX9rgIeBwm7zAZg8Vii9pqrvxjtwk0lpSrb1JXUP/SNh//rjZS;20:X6O54qD95BKSEiz3sL/absWhkFtV4MEBZqWdQS+zO7MFGiGtlYYPE8tCxtaII/7R+hBFWQZoWJ6aeVJvSpoLse/2kp77zLS0NaDknfcGwrnF3ySU3cWFD2az335UN3BtdiSgDaK8/ouRmUB0sPfkGf89cnMPK+vr2vYy4OLdZ1c= x-ms-office365-filtering-ht: Tenant X-MS-Office365-Filtering-Correlation-Id: 32a00091-88ba-4e6c-23d9-08d59db0ab2a x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB1031; x-ms-traffictypediagnostic: DM5PR2101MB1031: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(190383065149520)(104084551191319); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(3231221)(944501327)(52105095)(3002001)(10201501046)(6055026)(61426038)(61427038)(6041310)(20161123558120)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(6072148)(201708071742011);SRVR:DM5PR2101MB1031;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB1031; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(396003)(376002)(366004)(39380400002)(346002)(39860400002)(43544003)(189003)(199004)(2900100001)(10290500003)(99286004)(76176011)(14454004)(7736002)(11346002)(26005)(86612001)(72206003)(478600001)(36756003)(106356001)(66066001)(2616005)(186003)(22452003)(86362001)(68736007)(305945005)(54906003)(102836004)(486006)(110136005)(316002)(6506007)(446003)(107886003)(53936002)(4326008)(105586002)(6436002)(6486002)(476003)(6512007)(5660300001)(5250100002)(25786009)(3846002)(6116002)(1076002)(97736004)(3280700002)(2501003)(2906002)(81156014)(8676002)(10090500001)(81166006)(8936002)(3660700001)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB1031;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: jJm9bfsP6gW+5W7yu8B+ESiZCSd0yCHSy63Ae43qv0cwycy6eThZoL+WZ30MYkPBmsqf7BhYDi1fIZZx9HzBx790+R+YThm+qGx07ExR44ZV1FkULFqUrNZhlwEIdPJsQayuv2p9mSia0INxIO122cZO+hpPEp3aAHtA+iiA82dMG9UIjZ0uHrBSNSxKMA0FDmG5X2AvkFYZU2cGiU4X0rW/lzrv7Ps5GwncYP2wfaaTGdHumi38/abR6KJk+MjenpUYOExvGWcOMs57SBUEUiuk91x40c8Uty1HiYWM6J7g2x35Eij7mWjvxdmZ0T5BuB/AQgV90jBKNzslVzybmTgYmu3QNpnCqgugsLp/JMzFsa7Bmdko+1HomHQIOIP+lyAqv0FkvIYfeMoD31mMK7vKss2Yhf6KNwXv1p7xXrI= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 32a00091-88ba-4e6c-23d9-08d59db0ab2a X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:23:24.1748 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB1031 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Stefan Haberland [ Upstream commit e8ac01555d9e464249e8bb122337d6d6e5589ccc ] The safe offline processing may hang forever because it waits for I/O which can not be started because of the offline flag that prevents new I/O from being started. Allow I/O to be started during safe offline processing because in this special case we take care that the queues are empty before throwing away the device. Signed-off-by: Stefan Haberland Signed-off-by: Martin Schwidefsky Signed-off-by: Sasha Levin --- drivers/s390/block/dasd.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c index 5ecd40884f01..0da246505f70 100644 --- a/drivers/s390/block/dasd.c +++ b/drivers/s390/block/dasd.c @@ -1950,8 +1950,12 @@ static int __dasd_device_is_unusable(struct dasd_dev= ice *device, { int mask =3D ~(DASD_STOPPED_DC_WAIT | DASD_UNRESUMED_PM); =20 - if (test_bit(DASD_FLAG_OFFLINE, &device->flags)) { - /* dasd is being set offline. */ + if (test_bit(DASD_FLAG_OFFLINE, &device->flags) && + !test_bit(DASD_FLAG_SAFE_OFFLINE_RUNNING, &device->flags)) { + /* + * dasd is being set offline + * but it is no safe offline where we have to allow I/O + */ return 1; } if (device->stopped) { --=20 2.15.1