Merge branch '1367-threadsanitizer-data-race-dispatch-c-901-in-free_buffer' into 'master'
Resolve "ThreadSanitizer: data race dispatch.c:901 in free_buffer" Closes #1367 See merge request isc-projects/bind9!2613
This commit is contained in:
@@ -915,6 +915,10 @@ allocate_udp_buffer(dns_dispatch_t *disp) {
|
||||
void *temp;
|
||||
|
||||
LOCK(&disp->mgr->buffer_lock);
|
||||
if (disp->mgr->buffers >= disp->mgr->maxbuffers) {
|
||||
UNLOCK(&disp->mgr->buffer_lock);
|
||||
return (NULL);
|
||||
}
|
||||
bpool = disp->mgr->bpool;
|
||||
disp->mgr->buffers++;
|
||||
UNLOCK(&disp->mgr->buffer_lock);
|
||||
@@ -1045,9 +1049,11 @@ udp_recv(isc_event_t *ev_in, dns_dispatch_t *disp, dispsocket_t *dispsock) {
|
||||
mgr = disp->mgr;
|
||||
qid = mgr->qid;
|
||||
|
||||
LOCK(&disp->mgr->buffer_lock);
|
||||
dispatch_log(disp, LVL(90),
|
||||
"got packet: requests %d, buffers %d, recvs %d",
|
||||
disp->requests, disp->mgr->buffers, disp->recv_pending);
|
||||
UNLOCK(&disp->mgr->buffer_lock);
|
||||
|
||||
if (dispsock == NULL && ev->ev_type == ISC_SOCKEVENT_RECVDONE) {
|
||||
/*
|
||||
@@ -1498,9 +1504,6 @@ startrecv(dns_dispatch_t *disp, dispsocket_t *dispsock) {
|
||||
if (disp->recv_pending != 0 && dispsock == NULL)
|
||||
return (ISC_R_SUCCESS);
|
||||
|
||||
if (disp->mgr->buffers >= disp->mgr->maxbuffers)
|
||||
return (ISC_R_NOMEMORY);
|
||||
|
||||
if ((disp->attributes & DNS_DISPATCHATTR_EXCLUSIVE) != 0 &&
|
||||
dispsock == NULL)
|
||||
return (ISC_R_SUCCESS);
|
||||
|
||||
Reference in New Issue
Block a user