Return-Path: Received: from mail-sn1nam02on0094.outbound.protection.outlook.com ([104.47.36.94]:47840 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728006AbeH3WRu (ORCPT ); Thu, 30 Aug 2018 18:17:50 -0400 From: Sasha Levin To: "stable@vger.kernel.org" CC: Stefan Haberland , Martin Schwidefsky , Sasha Levin Subject: [PATCH AUTOSEL 4.9 27/42] s390/dasd: fix hanging offline processing due to canceled worker Date: Thu, 30 Aug 2018 18:14:09 +0000 Message-ID: <20180830181245.36526-27-alexander.levin@microsoft.com> References: <20180830181245.36526-1-alexander.levin@microsoft.com> In-Reply-To: <20180830181245.36526-1-alexander.levin@microsoft.com> Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org List-ID: 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 --- drivers/s390/block/dasd_eckd.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/s390/block/dasd_eckd.c b/drivers/s390/block/dasd_eckd.= c index 0f5bc2f8382b..3baf5fa2ed6a 100644 --- a/drivers/s390/block/dasd_eckd.c +++ b/drivers/s390/block/dasd_eckd.c @@ -2085,8 +2085,11 @@ static int dasd_eckd_basic_to_ready(struct dasd_devi= ce *device) =20 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; }; =20 --=20 2.17.1