Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp343612pxu; Thu, 7 Jan 2021 06:33:38 -0800 (PST) X-Google-Smtp-Source: ABdhPJxmNTUBKv6m7RV3nknQJV9b9+HdT3p7NcHjVtF5ITwZOu7e9W+YAJI8AD6mrqWTxA4oERH3 X-Received: by 2002:a17:906:4544:: with SMTP id s4mr6386653ejq.366.1610030018714; Thu, 07 Jan 2021 06:33:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610030018; cv=none; d=google.com; s=arc-20160816; b=lsPVCfjqAnPp1ebTFNwqGS5AXANWw3WTTHeZfZEF9Hsf/ke7nWvcD3Uy6lvhNX6R5O qmFlu8WbtgyjQs1WfXRk21bSS8b2DI0nJYuWXuDXd/nM5zJEhYUkhlqMiQfpwDFAXZwK ieHvjqJx4wX9TKYkNKrazDKZaeiyoH6QhhchaESEPzp1Tl9QIw5w0WoIlkm2RY09/jyN 3BM278/9UPpkkHTFdb7akxcphTUSHuXqSq8pA5HsU3tBrErFUYjG2b+4OBYkFbGPhD5v UHJVoi/jY3nYavXcgO7KJIkHIuLSU+rWMKk2tBwFv3N6eGj1g1NzuUfS8YplRdI0uFS3 9gNg== 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=7Tve3GSVjepkXh4ajRL6ofD2qX9fLi5b3dt+PzRzCPU=; b=C9msPppqZEVoveye1BluKLN4rAbcB9erHOUX5nWNrykrFWVDq00QWdtAzZsUYQdcaq k16a8nla9uHyRgTlbTl6IbMflu/3oupS2kh9rTIGeqyxW7camCSDHlk/lXf2DAqYyKw+ E+2FrVGZuCv4buwWWgUXEyq+UsQUDszHqvYPpzvrnzfTCqjQ0S6Lm+cLAdR1mAJjV7gB CSQmpD2P/QVLfW2IoeyFLZSZR+OuK5eiUy5f7BFm6FlU3G3fVim1O+OJwKY/UAal+gi0 ezrUzvOvb1KVzlflWcyiEx4+vZYcXaXHEDuODN2WyBrnGlIQ50nM0YnevVbhKY9XLkg+ DrnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=d9xLdCNQ; 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 ce12si2382271edb.604.2021.01.07.06.33.14; Thu, 07 Jan 2021 06:33:38 -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=d9xLdCNQ; 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 S1728571AbhAGObP (ORCPT + 99 others); Thu, 7 Jan 2021 09:31:15 -0500 Received: from mail.kernel.org ([198.145.29.99]:45220 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726319AbhAGObO (ORCPT ); Thu, 7 Jan 2021 09:31:14 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id A93CC2333E; Thu, 7 Jan 2021 14:30:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1610029834; bh=SzRj85u4EWvnhcMiIPnewAZwC7JLCp9Z8H5oIlYyk/M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=d9xLdCNQQSMp/b7UOAZEIiPKAZTUtJgNAvq79ouuBauizbnGrShheM5lR7P9Pl/l9 zDYfcNpAv1OPfC0KEVSlt21CuYXW5VFNWBv2/0E5go6Na9xGbDeU6SNrWq8w+jM/Uu nebt5Nw0L4kT+m7b5zxuKGl9p26ixC2Xn9APKSEQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Stefan Haberland , Jan Hoeppner , Jens Axboe , Sasha Levin Subject: [PATCH 4.14 10/29] s390/dasd: fix hanging device offline processing Date: Thu, 7 Jan 2021 15:31:25 +0100 Message-Id: <20210107143054.403017970@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210107143052.973437064@linuxfoundation.org> References: <20210107143052.973437064@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 [ Upstream commit 658a337a606f48b7ebe451591f7681d383fa115e ] 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: Sasha Levin --- drivers/s390/block/dasd_alias.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/s390/block/dasd_alias.c b/drivers/s390/block/dasd_alias.c index 487b16ace0060..0f70cae1c01e3 100644 --- a/drivers/s390/block/dasd_alias.c +++ b/drivers/s390/block/dasd_alias.c @@ -462,11 +462,19 @@ static int read_unit_address_configuration(struct dasd_device *device, 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_kfree_request(cqr, cqr->memdev); return rc; } -- 2.27.0