Skip to content

Commit c8b56e5

Browse files
bvanasschegregkh
authored andcommitted
RDMA/ib_srp: Fix a deadlock
[ Upstream commit 081bdc9 ] 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: ef6c49d ("IB/srp: Eliminate state SRP_TARGET_DEAD") Reported-by: syzbot+831661966588c802aae9@syzkaller.appspotmail.com Signed-off-by: Bart Van Assche <bvanassche@acm.org> Reviewed-by: Leon Romanovsky <leonro@nvidia.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent e7a66dd commit c8b56e5

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎drivers/infiniband/ulp/srp/ib_srp.c‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4038,9 +4038,11 @@ static void srp_remove_one(struct ib_device *device, void *client_data)
40384038
spin_unlock(&host->target_lock);
40394039

40404040
/*
4041-
* Wait for tl_err and target port removal tasks.
4041+
* srp_queue_remove_work() queues a call to
4042+
* srp_remove_target(). The latter function cancels
4043+
* target->tl_err_work so waiting for the remove works to
4044+
* finish is sufficient.
40424045
*/
4043-
flush_workqueue(system_long_wq);
40444046
flush_workqueue(srp_remove_wq);
40454047

40464048
kfree(host);

0 commit comments

Comments
 (0)