Skip to content

Commit 081bdc9

Browse files
bvanasschejgunthorpe
authored andcommitted
RDMA/ib_srp: Fix a deadlock
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>
1 parent c46fa89 commit 081bdc9

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
@@ -4047,9 +4047,11 @@ static void srp_remove_one(struct ib_device *device, void *client_data)
40474047
spin_unlock(&host->target_lock);
40484048

40494049
/*
4050-
* Wait for tl_err and target port removal tasks.
4050+
* srp_queue_remove_work() queues a call to
4051+
* srp_remove_target(). The latter function cancels
4052+
* target->tl_err_work so waiting for the remove works to
4053+
* finish is sufficient.
40514054
*/
4052-
flush_workqueue(system_long_wq);
40534055
flush_workqueue(srp_remove_wq);
40544056

40554057
kfree(host);

0 commit comments

Comments
 (0)