]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC 349467: Hold an explicit reference on the socket for the aiotx task.
authorJohn Baldwin <jhb@FreeBSD.org>
Mon, 19 Aug 2019 22:31:04 +0000 (22:31 +0000)
committerJohn Baldwin <jhb@FreeBSD.org>
Mon, 19 Aug 2019 22:31:04 +0000 (22:31 +0000)
commita2c08be993934789b7967cb27c65d83ac47d47e9
tree5f11e637033462e161092fab802275a96bae96df
parent03a44b3b17f60ac02edfcdbb833edf78a7fa8278
MFC 349467: Hold an explicit reference on the socket for the aiotx task.

Previously, the aiotx task relied on the aio jobs in the queue to hold
a reference on the socket.  However, when the last job is completed,
there is nothing left to hold a reference to the socket buffer lock
used to check if the queue is empty.  In addition, if the last job on
the queue is cancelled, the task can run with no queued jobs holding a
reference to the socket buffer lock the task uses to notice the queue
is empty.

Fix these races by holding an explicit reference on the socket when
the task is queued and dropping that reference when the task
completes.
sys/dev/cxgbe/tom/t4_cpl_io.c
sys/dev/cxgbe/tom/t4_tom.h