Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3526125pxf; Mon, 15 Mar 2021 11:30:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwUN3s5Ff98GOdqWihKVpQXUxH71e1MboIFXk+MElBBzRRPhOJ+/gWAuLmqHt1iL5jdeR93 X-Received: by 2002:a50:f9c8:: with SMTP id a8mr31765829edq.270.1615833055840; Mon, 15 Mar 2021 11:30:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615833055; cv=none; d=google.com; s=arc-20160816; b=NkGMQOFeP2wrDjTURu6GWLEaAU+GzplsFURPF9mLcpEfuB7ZzJXwsVjACuGlKFqqRZ 9EWgU5mJP4cyOYJG5s0MLPRQwcSpchZHA5JPrp9STglLeg8X/r2kEmwxEQhePtPiFERS DYgXYXZBPbyf2ZDWNGZyycgmwI3Ul4nzcv6QPpGFxJMd3yC9uKRiRlATlzPjBDSsmopx +wASX6DyLbLflnhdbLdpmiocLgbR+Fpi2IYeM1YSTo3ag0bHRXNAQROKz3o4MY/2mFKh XlZc1XAw0VAVfr5fgiAU44mTUEuYqHQDtnQvah70pXTwsP+xwUX6KQojka5XZ5RvDGNR Na4A== 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=MmumHxLuV4OFa+/fHY1xbBB7H52PUV0Gs+n4WHzR1L0=; b=Ukpyb3ClXs3kwYJQtqURA2kNM+PSofOnByV2VLSI0XNApveGeLP4Zr1xOo+5Yotrfs EutM9HR7ckYx6ciAm+3ZQot/TeSHJ2BeSMWLVmGWbw96xLrRYQK4BuOZmswgBqalFs8R 3l8AlGIatClbpgy7OoCN0CjlS+azRaPbQt8CvgurgTY/pOe3pqq8rTP7UIgPB9bkJ/Lc a9R6PeGHIrdsbS7D2769ieLs2zQPNMVtr54coQyfklzr7Z6sTLpL2swcHFvTbKFKJgS4 V/ztcowVgMz5dzcE5yPgMfr3qbE10AfwHqUCYsOkastf5ksTLzpe9/5o1/20yb9KYsbp gHdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=146wnL7M; 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 a11si11257831edr.205.2021.03.15.11.30.33; Mon, 15 Mar 2021 11:30:55 -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=146wnL7M; 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 S236484AbhCOOfq (ORCPT + 99 others); Mon, 15 Mar 2021 10:35:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:37582 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233450AbhCOOBl (ORCPT ); Mon, 15 Mar 2021 10:01:41 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0F96164F10; Mon, 15 Mar 2021 14:01:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816889; bh=HdP+5+/BeRS/KqbN7ECQPN4VR2LtCf/q1WvQ07E02j0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=146wnL7MsStE7GzpjstZeHk1jwB8EICABsdUw9KwtkohxE9KW+jYmZGywzXqarqbM rBltAfWu1Pn09TB0eQRRYLbmwWd47FMLX6mwoBUCdnC7C21y3tcRic9niMGTjQH523 BwscQt13drRVdNScKu8W8dWBd/AzTz56FYmqZw40= 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.11 184/306] s390/dasd: fix hanging IO request during DASD driver unbind Date: Mon, 15 Mar 2021 14:54:07 +0100 Message-Id: <20210315135513.836735326@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135507.611436477@linuxfoundation.org> References: <20210315135507.611436477@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 @@ -3068,7 +3068,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;