From: Christopher Faulet Date: Fri, 18 Jun 2021 07:05:49 +0000 (+0200) Subject: BUG/MINOR: resolvers: Use resolver's lock in resolv_srvrq_expire_task() X-Git-Tag: v2.5-dev1~83 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e886dd5c32aa1bc99acf48c5bb1826f80d96923d;p=thirdparty%2Fhaproxy.git BUG/MINOR: resolvers: Use resolver's lock in resolv_srvrq_expire_task() The commit dcac41806 ("BUG/MEDIUM: resolvers: Add a task on servers to check SRV resolution status") introduced a type. In resolv_srvrq_expire_task() function, the resolver's lock must be used instead of the resolver itself. This patch must be backported with the patch above (at least as far as 2.2). --- diff --git a/src/resolvers.c b/src/resolvers.c index a068137ff4..c05d2c5b64 100644 --- a/src/resolvers.c +++ b/src/resolvers.c @@ -609,9 +609,9 @@ static struct task *resolv_srvrq_expire_task(struct task *t, void *context, unsi if (!tick_is_expired(t->expire, now_ms)) goto end; - HA_SPIN_LOCK(DNS_LOCK, &srv->srvrq->resolvers); + HA_SPIN_LOCK(DNS_LOCK, &srv->srvrq->resolvers->lock); resolv_srvrq_cleanup_srv(srv); - HA_SPIN_UNLOCK(DNS_LOCK, &srv->srvrq->resolvers); + HA_SPIN_UNLOCK(DNS_LOCK, &srv->srvrq->resolvers->lock); end: return t;