]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Hold an explicit reference on the socket for the aiotx task.
authorjhb <jhb@FreeBSD.org>
Thu, 27 Jun 2019 19:36:30 +0000 (19:36 +0000)
committerjhb <jhb@FreeBSD.org>
Thu, 27 Jun 2019 19:36:30 +0000 (19:36 +0000)
commit6903ceff774d1124a1870a4733bd9e4e885e36a5
tree4b3b333a8c9aa76dfd3378355b53fa4af9b41ff0
parent2b448ee3cedffaa48579e464eac7cbee6b48d1cc
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.

Reviewed by: np
MFC after: 1 week
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D20539
sys/dev/cxgbe/tom/t4_cpl_io.c
sys/dev/cxgbe/tom/t4_tom.h