From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 68E99C433EF for ; Mon, 28 Feb 2022 17:29:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235400AbiB1R3v (ORCPT ); Mon, 28 Feb 2022 12:29:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45380 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237225AbiB1R2G (ORCPT ); Mon, 28 Feb 2022 12:28:06 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 23F0B62E9; Mon, 28 Feb 2022 09:27:22 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 91B7E6135F; Mon, 28 Feb 2022 17:27:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9BDC7C340E7; Mon, 28 Feb 2022 17:27:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1646069242; bh=syfSvU/7y2CmgSCUm/TKqAHV3WuNmsFV4FablvfBExk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VSIlNTZB+2ujE6Se1Ije/s5oSdfa6uW/PS7kx6ZUs8oRbSeLv4M2OCKbvZDW3qtGq 6i20XRJ6LkfjK072luOHMsxqTyNaBy+9oiQa6YKpbnW5HG66QEvbSssA1V2DmMqYHl ZslvR02ly1AwOj90W5l50281mCvE0bT5avUut/k4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, syzbot+831661966588c802aae9@syzkaller.appspotmail.com, Bart Van Assche , Leon Romanovsky , Jason Gunthorpe , Sasha Levin Subject: [PATCH 4.14 15/31] RDMA/ib_srp: Fix a deadlock Date: Mon, 28 Feb 2022 18:24:11 +0100 Message-Id: <20220228172201.340337725@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220228172159.515152296@linuxfoundation.org> References: <20220228172159.515152296@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: Bart Van Assche [ Upstream commit 081bdc9fe05bb23248f5effb6f811da3da4b8252 ] Remove the flush_workqueue(system_long_wq) call since flushing system_long_wq is deadlock-prone and since that call is redundant with a preceding cancel_work_sync() Link: https://lore.kernel.org/r/20220215210511.28303-3-bvanassche@acm.org Fixes: ef6c49d87c34 ("IB/srp: Eliminate state SRP_TARGET_DEAD") Reported-by: syzbot+831661966588c802aae9@syzkaller.appspotmail.com Signed-off-by: Bart Van Assche Reviewed-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe Signed-off-by: Sasha Levin --- drivers/infiniband/ulp/srp/ib_srp.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c index 9f7287f45d06f..63358c4c8e57c 100644 --- a/drivers/infiniband/ulp/srp/ib_srp.c +++ b/drivers/infiniband/ulp/srp/ib_srp.c @@ -3683,9 +3683,11 @@ static void srp_remove_one(struct ib_device *device, void *client_data) spin_unlock(&host->target_lock); /* - * Wait for tl_err and target port removal tasks. + * srp_queue_remove_work() queues a call to + * srp_remove_target(). The latter function cancels + * target->tl_err_work so waiting for the remove works to + * finish is sufficient. */ - flush_workqueue(system_long_wq); flush_workqueue(srp_remove_wq); kfree(host); -- 2.34.1