Skip to content

Commit c7956e4

Browse files
mrs303j-xiong
authored andcommitted
prov/tcp: Decrement subdomain ref count when key is not available
The following callchain for fi_mr_reg causes reference count increment for the subdomain even in case of FI_KEY_NOTAVAIL xnet_mplex_mr_regattr -> xnet_mr_regattr -> ofi_mr_regattr Its counterpart does not decrement refcount for FI_KEY_NOTAVAIL as it cannot be found in the memory region map. xnet_mplex_mr_close -> xnet_subdomains_mr_close As a result objects start to leak. The fix is to do the same as ofi_mr_close and decrement reference count for the domain in case of FI_KEY_NOTAVAIL. Signed-off-by: Grzegorz Morys <grzegorz.morys@gmail.com>
1 parent 9f4f8a2 commit c7956e4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

prov/tcp/src/xnet_domain.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ static void xnet_subdomains_mr_close(struct xnet_domain *domain, uint64_t mr_key
6767
ret = ofi_mr_map_remove(&subdomain->util_domain.mr_map, mr_key);
6868
ofi_genlock_unlock(&subdomain->util_domain.lock);
6969

70-
if (!ret)
70+
if (!ret || (mr_key == FI_KEY_NOTAVAIL))
7171
ofi_atomic_dec32(&subdomain->util_domain.ref);
7272
}
7373
}

0 commit comments

Comments
 (0)