Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp3111307pxm; Mon, 28 Feb 2022 12:14:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJyyxJ5DdvQ3FCNLm5IEEjHpLbk8MniKWXNyk6FW1VEx0Fxu7/5wJaHfiz/3lPg86jMq/D80 X-Received: by 2002:a17:90b:364f:b0:1bc:7337:d7df with SMTP id nh15-20020a17090b364f00b001bc7337d7dfmr18448355pjb.61.1646079269569; Mon, 28 Feb 2022 12:14:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646079269; cv=none; d=google.com; s=arc-20160816; b=X15sFQJHOiXESAFafreMxQZlRK7schkez9mtGxXGTJQqDNgZlg2tEpiQ3f9jpOfL7N bKeRlbDv1nr2XTxoAd+N55wI06P9HiZjKJj0oy+YSpl65O+KwthU+7EK+L/NVtOyeMbd Bh8e6kutUBB8oXtLB/6tmHEsiTDSczKjWOc1EVM67baHpey1RApSwouzg8D7cFJLeuEq N9MyFt8HBqkIkJwSr0IR609E4JN48AYC+FbA8PgXk9Sdi5DN573ADHnDr1CM/BbP2EIQ K+EYcBDAhu9I35JqX/gAMW1y4kEJVIJ0SIHJDdSGf/TYdqGPKjuuOpo+Qv5oAxJnndTa ljNg== 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=VT/KV/7WUBonoiFxT/QyERqEPci9xOTbWvpNSVBvY1M=; b=nb+XqqY63gNce+hIO72dnc8FGZUEqwOU14+SPIbuJnbsEvaTallZ+2/YyrRoHBlvdp EeKIEZF0iM5zftFhWrP6iZZCIFQESJdISuFEKAbJny5sc05ARk1FAdctPMls6L/sk4Vi bUWPLeeZipDnCpvk34/7oYuzjH2DtxM73fWuebMM35WR7ZU2mL5fUxqaYk6em7ss30SO MzdFBaazHDRr/xTGT9ZfPJwQjwkwPCXAL2yoSRiwnztNM1am6s1PoWx1Ld+uJ4rTk/4s t1qcseuRELmBiLyAZzZwVFXYmwBqhQLVeZdr9frXVPN2a57AsC8jEYJQhLaKm2QXHNin IgBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=g17zj+6C; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id f15-20020a170902ff0f00b0014fe58433e0si9979271plj.406.2022.02.28.12.14.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Feb 2022 12:14:29 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=g17zj+6C; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C2126167F9D; Mon, 28 Feb 2022 11:36:53 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237473AbiB1Rj2 (ORCPT + 99 others); Mon, 28 Feb 2022 12:39:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238331AbiB1RhZ (ORCPT ); Mon, 28 Feb 2022 12:37:25 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 48D956369; Mon, 28 Feb 2022 09:32: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 ams.source.kernel.org (Postfix) with ESMTPS id 77418B815AE; Mon, 28 Feb 2022 17:32:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D7179C340E7; Mon, 28 Feb 2022 17:32:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1646069539; bh=9Q2zckVU2MjYx6EoLKZDAOT6Znqr42HIt8j8+BfBou4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=g17zj+6ClA/PVEKXfQaQISI7Lou15MCQT8IFwJ2xvnnM9bqyo5vjWJpTc2qRUybcy r7GW9zHYxj4kWAFrBeaoePTjqBItQR8LJXZTL1sf/mkCrn5eIKNmVLtOC5WaLg3e6Y lWvCxJlo6mTK918r9/Gn57LUmDAts+XAvQ29dCv8= 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 5.4 31/53] RDMA/ib_srp: Fix a deadlock Date: Mon, 28 Feb 2022 18:24:29 +0100 Message-Id: <20220228172250.528772715@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220228172248.232273337@linuxfoundation.org> References: <20220228172248.232273337@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 8708ed5477e99..dac806b715afa 100644 --- a/drivers/infiniband/ulp/srp/ib_srp.c +++ b/drivers/infiniband/ulp/srp/ib_srp.c @@ -4222,9 +4222,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