Don't grab SOCK_LOCK for soref() when queuing an AIO request.

The AIO job holds a reference on the associated file descriptor, so the
socket's count should already be > 0.  This fixes a LOR with the socket
buffer lock after recent socket locking changes in HEAD.

Sponsored by:	Chelsio Communications
This commit is contained in:
jhb 2017-08-25 23:10:27 +00:00
parent a7e8937b17
commit 1509e7d93a

View File

@ -746,11 +746,7 @@ sowakeup_aio(struct socket *so, struct sockbuf *sb)
if (sb->sb_flags & SB_AIO_RUNNING)
return;
sb->sb_flags |= SB_AIO_RUNNING;
if (sb == &so->so_snd)
SOCK_LOCK(so);
soref(so);
if (sb == &so->so_snd)
SOCK_UNLOCK(so);
soaio_enqueue(&sb->sb_aiotask);
}