Received: by 10.192.165.156 with SMTP id m28csp1098293imm; Wed, 11 Apr 2018 12:22:20 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/0GpR2R0nMpzjt/Q97HaS9NY3zczk4AKXyUKDMnrARg6EWsYXVx2v1AUBa2DfsE0RiLH0Z X-Received: by 10.101.96.141 with SMTP id t13mr4426964pgu.222.1523474540030; Wed, 11 Apr 2018 12:22:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523474539; cv=none; d=google.com; s=arc-20160816; b=Ttc81gYt5sN+2VMq18P345c4Trt/Dbst38npwx9Yg8yatOkQiJyksC+FiuKb/UyIce LG1N7k6kWm82zTw9wIx0eWGWbdttdXrv35ypLO6gGHJkUVGeQXpzwEqvRSv0BNd679f5 yyBpgeFucuk0IcLFSfeGa+yqoRrKTZ1y4omdoCn3vdWPw1hATAcc6lk1LhRgNOKmviHu alzQnWd6Tek3Z31i64BfxQ+jcDgTKkp/65uSCGnJjGcY/TnkvUxc7jENKRD5MeAKsCGP ZyQoUWC1b2kK+gxResteeZmL84roLZP8m8xFSq8vWCvl2E3A/0cG0jflayuWgnVkQM/A huqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=yWNXxUtR2CTglYd00gh5NHXJ0XwbsqwprOklhWpZ0GI=; b=rFhx06+LaRBBNskdhxFrEt0twMWrIaaqEOP3iax6X+l7ZAqEvdvni6zw1SOI09pl93 kP1GZsbiE0fTtqOBIEm+Jhoq7Oc1pVgl2+vd92CMESxspNu4R85Vo6FzCqOw0E+PsNCR sUELcQvFMWNsh7Nkl4AZP6Ppv+x6pDapvKtdx8dFUEFwBoWekApnw1hfSpggASh6QgjX OVEpBRJhhbDuf/kP+BI7eEk75WyyK9S310KXwUTFOS8t9lJH5gv/4+ubrPyl+NTUSGwA xa0ryfVTY9aszo5qAcdW3vv8ITigAguoiSdQ9c6QaAp8L3eAq3Sr0ozqhFzPMnszWSoa 709w== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z23si1142014pgc.484.2018.04.11.12.21.43; Wed, 11 Apr 2018 12:22:19 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935093AbeDKTFp (ORCPT + 99 others); Wed, 11 Apr 2018 15:05:45 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:40554 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934041AbeDKTFl (ORCPT ); Wed, 11 Apr 2018 15:05:41 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 96079CE3; Wed, 11 Apr 2018 19:05:40 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Stefan Haberland , Martin Schwidefsky , Sasha Levin Subject: [PATCH 4.9 252/310] s390/dasd: fix hanging safe offline Date: Wed, 11 Apr 2018 20:36:31 +0200 Message-Id: <20180411183633.278275747@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180411183622.305902791@linuxfoundation.org> References: <20180411183622.305902791@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ 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 Signed-off-by: Greg Kroah-Hartman --- drivers/s390/block/dasd.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) --- a/drivers/s390/block/dasd.c +++ b/drivers/s390/block/dasd.c @@ -1950,8 +1950,12 @@ static int __dasd_device_is_unusable(str { int mask = ~(DASD_STOPPED_DC_WAIT | DASD_UNRESUMED_PM); - 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) {