Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp730718imm; Thu, 13 Sep 2018 06:58:20 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbUskgtoLHWnCxUgQjPiQOUpU0xg8/Fz6OSU3jv+L3vEFpgfZXb+1zYwz8beAAixu4S2y0t X-Received: by 2002:a65:560a:: with SMTP id l10-v6mr7425470pgs.130.1536847100075; Thu, 13 Sep 2018 06:58:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536847100; cv=none; d=google.com; s=arc-20160816; b=H7ux7gkeQQVWwhyaZo9NKRFKWx55ZxUIA3foRttTbppxfBakpCAAB8h9CzASifHeJi 3l3Rtq/l9jZEn4VplYA9BVd67e07XcfglscJFoQoUbGlgW/5g5GoxzAl2ghIzXh+6kM5 dslxo3JeG3BBdd+ZG/A6ehhE1RL5HNrjGL1xvcKqyoqB8uj7qU+n8x0sknvZ/YbvM5ln DFtYX2sx55kTqJs8afukbJXFIxCemwm+FiB1JPk7UKQatPCLhzT2oGP9TrGO19TTvzrT 2yTHRn9tDkcAyDiyedmO4J/ZDALon1U4mn4o92Nug98dNXpb7oUspTKafTbfL4UFq81s YmUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from; bh=LIEiI+PUzZRWq2WOqk1t2jxuHdJ3uMy0c1Dk/lNtuXw=; b=efR0D10yqTFdW2RIQsKT3lM78kGNJtgQWepvYSZuW8AZl/pW90OCLkFWFmXPw28MWa U8/EYKHP5qHeRXk+QTVZT+zppwUY2fq7AMEUS5N+1vNXKyrTvm2yHyBvcFlSSSjghZg7 H9dpG0DLgowRduL/Wl2r+YFPPoJWhBXgzHLkIGBwh7NIJM0FqTIi+zwyc0eo8eoj/OnZ MmQeX5JjQv2R2ii6GYq5ZEZnU8gKVsfDyeW1PTS2JV27vy9ogOyDJH5ECmpjyIKHNjb6 MnnSRl9TW160XV8AIL2NfgXd8AMW6iEtoBIGb1Es57gz0iwkRtPIaxl4F3rw9wRQMHyY +SGw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j125-v6si4023748pfc.243.2018.09.13.06.58.04; Thu, 13 Sep 2018 06:58:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731525AbeIMTH1 (ORCPT + 99 others); Thu, 13 Sep 2018 15:07:27 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:34434 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728566AbeIMTH1 (ORCPT ); Thu, 13 Sep 2018 15:07:27 -0400 Received: from localhost (ip-213-127-77-73.ip.prioritytelecom.net [213.127.77.73]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 650C7D0E; Thu, 13 Sep 2018 13:57:50 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jan Hoeppner , Stefan Haberland , Martin Schwidefsky , Sasha Levin Subject: [PATCH 4.18 103/197] s390/dasd: fix hanging offline processing due to canceled worker Date: Thu, 13 Sep 2018 15:30:52 +0200 Message-Id: <20180913131845.666179939@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180913131841.568116777@linuxfoundation.org> References: <20180913131841.568116777@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Stefan Haberland [ Upstream commit 669f3765b755fd8739ab46ce3a9c6292ce8b3d2a ] During offline processing two worker threads are canceled without freeing the device reference which leads to a hanging offline process. Reviewed-by: Jan Hoeppner Signed-off-by: Stefan Haberland Signed-off-by: Martin Schwidefsky Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/s390/block/dasd_eckd.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) --- a/drivers/s390/block/dasd_eckd.c +++ b/drivers/s390/block/dasd_eckd.c @@ -2035,8 +2035,11 @@ static int dasd_eckd_basic_to_ready(stru static int dasd_eckd_online_to_ready(struct dasd_device *device) { - cancel_work_sync(&device->reload_device); - cancel_work_sync(&device->kick_validate); + if (cancel_work_sync(&device->reload_device)) + dasd_put_device(device); + if (cancel_work_sync(&device->kick_validate)) + dasd_put_device(device); + return 0; };