Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3527763pxf; Mon, 15 Mar 2021 11:33:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxh03y8htosBe+O3aAt2uPkJFor9k1V798wumZ54BSflCrgRQ0jtCw3TPt40nw+KdGEflZJ X-Received: by 2002:a17:906:cecc:: with SMTP id si12mr25224841ejb.461.1615833185517; Mon, 15 Mar 2021 11:33:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615833185; cv=none; d=google.com; s=arc-20160816; b=eP64LtuDlJoSp9W2CglgmyKMRKIFaWeNsE5op9+xU5ZmTutIVB5roKuNlQDvZtJazz Hf/9DYtB1RT+B1W7faId4DM4LiMoJkDEXekv8zNKU5hy56ptSrH5ECR6TwksiaDcmk9M fWRTs3wCcO0OGyrW2WMe5wm4O10o5Yz+335UGhqxBMFWOWg4pHBZ4OB/gX+i+gtKY+Ga IiXyPwTHeSfAZouF0WXuE7FQJPjPFLZaR+/a7h98v2fCvHSk0CBakKCL/k0NXJOLan/L CWY9++7I8L4wxqOSg8AKRPcvwEAOpM3Iam5rQsr6WG+MySwGs53mzVDCxbdZkoYFbgGu KSXQ== 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=Dg58rU+l+7hmQiGouhrqthD+/ZMm5TKZcUKXxAp6mEnBC/963R2bj4iHm3Fnx3QCOp TGXTp0zOiLqXsrvn+q1gUL6hcHK7LE2bocVrrPBDKJbmxCZoIzsS8hdbI1u/gnv9xMSm ONir8pALczfE4KDT17MuBDJdtYLHN0+816W8SKYV8zpnLYGjyvPapKjOrxgxZm5DX9ty 63Jo+HLyt5/7ePm3oJK1vsOUONLUsXN7zZPx3MSFdhbpLqo6W8+0jjBlUr9Soj8WlcBD 0w9tiIudfKy0w+/e+ig0vEfOSHNVAY3JSKnpzxZ8cRa9Cl6FQFKOAmbKJZ26obUo3DzJ uptQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=jQMYhWdp; 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 z23si12306286ejw.362.2021.03.15.11.32.43; Mon, 15 Mar 2021 11:33: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=jQMYhWdp; 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 S235220AbhCOOiq (ORCPT + 99 others); Mon, 15 Mar 2021 10:38:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:48932 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233652AbhCOOCQ (ORCPT ); Mon, 15 Mar 2021 10:02:16 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 483E764EF1; Mon, 15 Mar 2021 14:02:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816924; bh=lGNL/JT7lIjRPxO0TIltZb7Yz1P6YQBKW48n2PCB4J4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jQMYhWdpzWEWEkaVxuNIkRxt9OaoBBsMrgCgnMhqIav43tLg5UWlPDYmyGcztTPFG StGizW+QlDKLbATOndzCKIlbPYvfV0PNX6OflI5YU7tTwX/6filsj0Co9b0mhurLHi QV48LUb4953+JLnV3AX85sjCVTLA2uVye7ChAux4= 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.10 190/290] s390/dasd: fix hanging IO request during DASD driver unbind Date: Mon, 15 Mar 2021 14:54:43 +0100 Message-Id: <20210315135548.341361789@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135541.921894249@linuxfoundation.org> References: <20210315135541.921894249@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;