Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9093664pxu; Mon, 28 Dec 2020 06:29:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJwEW6+HBM36+UmarMVSrRlaBMs84w1xEdfD2RqmaBQ40THE6J3GoDIRSJicG0p2mm96/Jqt X-Received: by 2002:a17:906:3881:: with SMTP id q1mr42753222ejd.490.1609165767049; Mon, 28 Dec 2020 06:29:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609165767; cv=none; d=google.com; s=arc-20160816; b=fHDWhhnyihggKWJPLR7GzjdQuLMB0a09KT8EFEoi4u4ZwH+cFF8URo821q90JQ55Up ij1V6lGdfAwl69gmCMUWgLybgXouGEag7AqiRhoTOmGjtI7SSwXSZSfPBkjNEZjW5atZ WwFPhgBCHtQCKAafPi8wh3sqksKB3GGAUNjFlj9UdnNHn+fRudX69Dl5L1PltCVSEPId CIlJ5bjm44W3aUYjpPmURXDEuIzyoxiZtoMtdFguhwrL+ig4kBagvonW9fKf59XS6Poh pv3eARHULjDNSUE8zYT+E/xdCosoGPT+Mxk8fXXCVq0L8ksfOw4o/WL8q4GXqWWf0UQB WevA== 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=pLx8PhN48qmYGWNkgQWPEZA8caLOkljYuAwS+PfbWaE=; b=veNHrAdtvYlaLbxkqdk1nhfkZWNUj1HGhMZkuGjS4iqK2FTngMvp7kUN1wen3Fsd2w 0s6vi4PvIy3qGqw+6WFuSh/Vy2UUspFgXvcyQxF7LsfGmJTom008r6wKhBTZmDxerbVL DMIyID7BrG6aS043q7VXMbwgmwMMQBh6O4nSwAWklf6+RL1PSlNzOhA5q/A3+0jwYOBe LHWGBHMRMCgLY8+CcCOlWTqPVcPHw9L90znBEYsIXw/ijIQ3xU7QoSN7GejyVmzepGSB /vTNhD0DgsU2OL2ku2OGOpBn6LFO4vWLg0527Yw65wgnCctFN+rUw6L/pP/WmT+QrZeR r18g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=kVfxP8vw; 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 z3si20349668eda.136.2020.12.28.06.29.04; Mon, 28 Dec 2020 06:29:27 -0800 (PST) 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=kVfxP8vw; 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 S2503759AbgL1O0S (ORCPT + 99 others); Mon, 28 Dec 2020 09:26:18 -0500 Received: from mail.kernel.org ([198.145.29.99]:33622 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2503276AbgL1OZo (ORCPT ); Mon, 28 Dec 2020 09:25:44 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id D3CCD2245C; Mon, 28 Dec 2020 14:25:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609165503; bh=g2Zt8DLmwegqzrGW2W4zZDFBNp5yfj7K/uAC3UoCwFo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kVfxP8vwUr/mnr2CGUntk0rYs8yuQ0ZtdPduj7Eo6aOqkpJgBEk5LRpYGXgxBZcOQ RAAjhm1sSYUH/TWf2uovKawuNB1jQt8atqPFi9PChNHFyDGGML38rXsa4KbYurf/35 SRX6Dn/wHevBgYh7eR7FjyeXUMOX1c6ckwz85OxA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Stefan Haberland , Jan Hoeppner , Jens Axboe Subject: [PATCH 5.10 555/717] s390/dasd: fix hanging device offline processing Date: Mon, 28 Dec 2020 13:49:13 +0100 Message-Id: <20201228125047.523184966@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228125020.963311703@linuxfoundation.org> References: <20201228125020.963311703@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: Stefan Haberland commit 658a337a606f48b7ebe451591f7681d383fa115e upstream. For an LCU update a read unit address configuration IO is required. This is started using sleep_on(), which has early exit paths in case the device is not usable for IO. For example when it is in offline processing. In those cases the LCU update should fail and not be retried. Therefore lcu_update_work checks if EOPNOTSUPP is returned or not. Commit 41995342b40c ("s390/dasd: fix endless loop after read unit address configuration") accidentally removed the EOPNOTSUPP return code from read_unit_address_configuration(), which in turn might lead to an endless loop of the LCU update in offline processing. Fix by returning EOPNOTSUPP again if the device is not able to perform the request. Fixes: 41995342b40c ("s390/dasd: fix endless loop after read unit address configuration") Cc: stable@vger.kernel.org #5.3 Signed-off-by: Stefan Haberland Reviewed-by: Jan Hoeppner Signed-off-by: Jens Axboe Signed-off-by: Greg Kroah-Hartman --- drivers/s390/block/dasd_alias.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) --- a/drivers/s390/block/dasd_alias.c +++ b/drivers/s390/block/dasd_alias.c @@ -462,11 +462,19 @@ static int read_unit_address_configurati spin_unlock_irqrestore(&lcu->lock, flags); rc = dasd_sleep_on(cqr); - if (rc && !suborder_not_supported(cqr)) { + if (!rc) + goto out; + + if (suborder_not_supported(cqr)) { + /* suborder not supported or device unusable for IO */ + rc = -EOPNOTSUPP; + } else { + /* IO failed but should be retried */ spin_lock_irqsave(&lcu->lock, flags); lcu->flags |= NEED_UAC_UPDATE; spin_unlock_irqrestore(&lcu->lock, flags); } +out: dasd_sfree_request(cqr, cqr->memdev); return rc; }