Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3520590pxf; Mon, 15 Mar 2021 11:23:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx/uLRLH+x/5GaZIYvH7qDf1ijQd3w5AJjZVyAxYow5jJhgJTaXr6B7imvGk8NTx9DjQP1T X-Received: by 2002:a05:6402:10c6:: with SMTP id p6mr31479105edu.241.1615832591084; Mon, 15 Mar 2021 11:23:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615832591; cv=none; d=google.com; s=arc-20160816; b=eX3y7rfe/SrO9b6cidykoXu5MnaAQcz+0Se4HKgC/NL1gtMtklfmkZQh5ntNbe9z/5 6IlXmPT7vfwdb2xts2VidBItgOCdjIzbl32EZ40WQRNsM4NOseJxLoye8eamLxJNud3y OtoL0+cK3aYw920kq0/9P+Y8ON31W/wQLIJXApjyedvy9092VCbbxJ21ICmreQAclw+3 lVm81Ymxp8h93r19ogsMYCRD2n+Td4s4dnCGc/ExawWSJOz1k+XJv31l/+q+I3XAroaF JuHirWT88DjMWOjyQlP+y7pJcgF1kDEMJgp6wIprGEz3YLU6LgW2QtjHTw7jSGwRpwiL 5uDQ== 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=F3veSO8IOcfksGErTltnt0JuJXyH+RtsaQrygqWifj0=; b=oEGPZMI1INP8JPUmKkdsDY5qDhQk2ddV+5Z1p3gDXjW2fCEygGFq9E86X9a51NjbJv AVCo8jYo6ISbv7rHa27LcxclKwBhFjqGDzcc5ArVgf3U07P8AwrX2YDy9m85KaEU/Mwp HdZUeNEd+gh5aqmHRkq2tYxl022kkqr7k1E2A51ZIE+Dwx5EduWY+im8RQtNLapX5hJz ZskfV7qjN8gEbfWin4vf09DrMyxNXIJMVjSjOsK0ezEnaNfGHQTg3q7MMJUZ5Rgw3fC+ dJvyuY4lo16N2rmSkLM3ytXbm7h+jX4l0NiU3lwrb0E4EDalHMHYXnFz5QvHba4nGm8Q ltGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=R+SG06ti; 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 n28si2695765edc.564.2021.03.15.11.22.48; Mon, 15 Mar 2021 11:23:11 -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=R+SG06ti; 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 S233814AbhCOOVi (ORCPT + 99 others); Mon, 15 Mar 2021 10:21:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:34900 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232884AbhCOOAF (ORCPT ); Mon, 15 Mar 2021 10:00:05 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D00BB64F5E; Mon, 15 Mar 2021 13:59:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816787; bh=foAQqbn99H8ZvIr8aDDOBpEBQF6iFeotkCTkcixB7k8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=R+SG06ti3KkmiRYGkHLoXnhgQm7bEgYFM3EBzjKNsI55WViF3ObiBTn5PTmR/PE6i wZb0REiZ1H2nxt01TpioZfE9sdg3C0lkKKiHuHgfS2SYcLWc4PMWkIBwvtYSCqNdai 3JGYUcKPKdXIPVzoj9Lm1g2vY1loFmnuRlMGBc6M= 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 4.19 067/120] s390/dasd: fix hanging IO request during DASD driver unbind Date: Mon, 15 Mar 2021 14:56:58 +0100 Message-Id: <20210315135722.167047466@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135720.002213995@linuxfoundation.org> References: <20210315135720.002213995@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 @@ -2940,7 +2940,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;