Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3522466pxf; Mon, 15 Mar 2021 11:26:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzoO5o4SQDi/XrDv+vquN483Wl72cooa45mUcZQv2OepJtSXW9DVsOYn5US8Y+vmXmczSjd X-Received: by 2002:a17:906:1dc2:: with SMTP id v2mr25438546ejh.350.1615832765383; Mon, 15 Mar 2021 11:26:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615832765; cv=none; d=google.com; s=arc-20160816; b=u6t2o+tum2+ZI+wgsK1ICSFfElyp43ZcZW7XP+IUQX+h3FEWM5yq9wDl0sW4PykKUy lPyPh8yQ3x3aZ4h3crCId5RYPH+d1Ul5kt/dZhefCLPBgC0d14Y3vTwP5WxiC8EwzAaZ lSNRMojoUaVCgQbfPoJqqFO7BWpwhhN06+m4hYLZwChS+HzIq0IgKLE8+pKM4nvxmmIz FtdnDLhioaPBjftR2Sl2ipMqmkYLKLzytXlPq7O+OX0ZBN1C3CiNLpCQNJ+DtYDkGsSg 7W0aJG9xVvyzJ/Zad1V6rwqd6ABCpfygXurqdN173sCc430f4RbQlqSbtiwxCbc3HelA A31A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=wct3TkKjxi4WLiu1q+U/wu1Qes2tEQUKANQWFP55ltw=; b=UPwxkrRadrRKAkpnV0f/hsYV5rwl8I7iqQGuzfNNI0pfFHAg+WiN2PHcmFoeHzQHQZ +MC27cOrI0SVeJh6jCgwel5hof3TRUQjPZO5+KFXEKJKEK+5z7/q/UyGbw9liO7sQD75 WSpob6uoTYj43ff31jsh4uGpGhWgDrc2wDroeUJa0eXTEvo+OBuEA9fkoWbvVrJTzC9S KbM8/F9vh2ZFUHGOTAL5cWF0wvmKKzwv9vVvVSB5W/76xaaRAVMxYmRGwTvZZnP7gyUl nPD1ZYImASnQ5VUbD97zMTIld8KvF8cTI31JYQvEef2jm/a7AUi5Z+305Ehcmzmtxogu Fc9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=i41FctDk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f20si11699214edr.318.2021.03.15.11.25.43; Mon, 15 Mar 2021 11:26:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=i41FctDk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238740AbhCOOXm (ORCPT + 99 others); Mon, 15 Mar 2021 10:23:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:35446 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232848AbhCOOAC (ORCPT ); Mon, 15 Mar 2021 10:00:02 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8431C64F0B; Mon, 15 Mar 2021 13:59:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816772; bh=lGNL/JT7lIjRPxO0TIltZb7Yz1P6YQBKW48n2PCB4J4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=i41FctDkY5lBdapQzi4KdgU5wSsINCBrARZgVCATW8r7B97JGI7etIkHB8KtD5cou BpoN0FLrqPYTT0YJnp5dO1cSpnZt/M45+X4ojiQwuArM9qJeQ68N9/ZMbTZm/IBx9/ LoxaM9S/qC8YlHA6qU8CR6Q0HFRjHvk/2ocb62Fk= From: gregkh@linuxfoundation.org To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Stefan Haberland , Bjoern Walk , Jan Hoeppner , Jens Axboe Subject: [PATCH 5.4 099/168] s390/dasd: fix hanging IO request during DASD driver unbind Date: Mon, 15 Mar 2021 14:55:31 +0100 Message-Id: <20210315135553.623696674@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135550.333963635@linuxfoundation.org> References: <20210315135550.333963635@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Greg Kroah-Hartman From: Stefan Haberland commit 66f669a272898feb1c69b770e1504aa2ec7723d1 upstream. Prevent that an IO request is build during device shutdown initiated by a driver unbind. This request will never be able to be processed or canceled and will hang forever. This will lead also to a hanging unbind. Fix by checking not only if the device is in READY state but also check that there is no device offline initiated before building a new IO request. Fixes: e443343e509a ("s390/dasd: blk-mq conversion") Cc: # v4.14+ Signed-off-by: Stefan Haberland Tested-by: Bjoern Walk Reviewed-by: Jan Hoeppner Signed-off-by: Jens Axboe Signed-off-by: Greg Kroah-Hartman --- drivers/s390/block/dasd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/s390/block/dasd.c +++ b/drivers/s390/block/dasd.c @@ -3087,7 +3087,8 @@ static blk_status_t do_dasd_request(stru basedev = block->base; spin_lock_irq(&dq->lock); - if (basedev->state < DASD_STATE_READY) { + if (basedev->state < DASD_STATE_READY || + test_bit(DASD_FLAG_OFFLINE, &basedev->flags)) { DBF_DEV_EVENT(DBF_ERR, basedev, "device not ready for request %p", req); rc = BLK_STS_IOERR;