]> git.ipfire.org Git - thirdparty/bind9.git/commit
Do not recheck DNS_ZONEFLG_LOADPENDING in zone_asyncload()
authorMichał Kępień <michal@isc.org>
Thu, 15 Feb 2018 19:31:54 +0000 (20:31 +0100)
committerMichał Kępień <michal@isc.org>
Fri, 16 Feb 2018 07:47:40 +0000 (08:47 +0100)
commit840c9348bfaf2de03423dece1ec1493a26d71e30
tree08276da29ccd37372a577c7efb129e369fdab71d
parent3395f6fac3b6d4fa3162a373b6273efe64509054
Do not recheck DNS_ZONEFLG_LOADPENDING in zone_asyncload()

Remove a block of code which dates back to commit 8a2ab2b9203, when
dns_zone_asyncload() did not yet check DNS_ZONEFLG_LOADPENDING.
Currently, no race in accessing DNS_ZONEFLG_LOADPENDING is possible any
more, because:

  - dns_zone_asyncload() is still the only function which may queue
    zone_asyncload(),

  - dns_zone_asyncload() accesses DNS_ZONEFLG_LOADPENDING under a lock
    (and potentially queues an event under the same lock),

  - DNS_ZONEFLG_LOADPENDING is not cleared until the load actually
    completes.

Thus, the rechecking code can be safely removed from zone_asyncload().

Note that this also brings zone_asyncload() to a state in which the
completion callback is always invoked.  This is required to prevent
leaking memory in case something goes wrong in zone_asyncload() and a
zone table the zone belongs to is indefinitely left with a positive
reference count.
lib/dns/zone.c