diff --git a/src/container/srv_target.c b/src/container/srv_target.c index fdf3a915f04..49335494d38 100644 --- a/src/container/srv_target.c +++ b/src/container/srv_target.c @@ -690,7 +690,7 @@ cont_child_alloc_ref(void *co_uuid, unsigned int ksize, void *po_uuid, goto out_finish_cond; } - rc = vos_cont_open(cont->sc_pool->spc_hdl, co_uuid, &cont->sc_hdl); + rc = VOS_CONT_OPEN(cont->sc_pool->spc_hdl, co_uuid, &cont->sc_hdl); if (rc != 0) goto out_pool; @@ -724,7 +724,7 @@ cont_child_alloc_ref(void *co_uuid, unsigned int ksize, void *po_uuid, return 0; out_cont: - vos_cont_close(cont->sc_hdl); + VOS_CONT_CLOSE(cont->sc_hdl); out_pool: ds_pool_child_put(cont->sc_pool); out_finish_cond: @@ -753,11 +753,10 @@ cont_child_free_ref(struct daos_llink *llink) D_ASSERT(daos_handle_is_valid(cont->sc_hdl)); D_ASSERT(d_list_empty(&cont->sc_open_hdls)); - D_DEBUG(DB_MD, DF_CONT": freeing\n", - DP_CONT(cont->sc_pool->spc_uuid, cont->sc_uuid)); + D_INFO(DF_CONT ": to free %p\n", DP_CONT(cont->sc_pool->spc_uuid, cont->sc_uuid), cont); cont_tgt_track_eph_fini(cont); - vos_cont_close(cont->sc_hdl); + VOS_CONT_CLOSE(cont->sc_hdl); ds_pool_child_put(cont->sc_pool); daos_csummer_destroy(&cont->sc_csummer); D_FREE(cont->sc_snapshots); @@ -767,6 +766,7 @@ cont_child_free_ref(struct daos_llink *llink) ABT_cond_free(&cont->sc_fini_cond); ABT_mutex_free(&cont->sc_mutex); ABT_mutex_free(&cont->sc_open_mutex); + D_INFO("freeing %p\n", cont); D_FREE(cont); } @@ -2041,7 +2041,7 @@ cont_query_one(void *vin) if (pool_child == NULL) D_GOTO(ds_pool_hdl, rc = -DER_NO_HDL); - rc = vos_cont_open(pool_child->spc_hdl, in->tqi_cont_uuid, &vos_chdl); + rc = VOS_CONT_OPEN(pool_child->spc_hdl, in->tqi_cont_uuid, &vos_chdl); if (rc != 0) { D_ERROR(DF_CONT ": Opening VOS container open handle failed: " DF_RC "\n", DP_CONT(in->tqi_pool_uuid, in->tqi_cont_uuid), DP_RC(rc)); @@ -2057,7 +2057,7 @@ cont_query_one(void *vin) pack_args->xcq_hae = vos_cinfo.ci_hae; out: - vos_cont_close(vos_chdl); + VOS_CONT_CLOSE(vos_chdl); ds_child: ds_pool_child_put(pool_child); ds_pool_hdl: @@ -2405,7 +2405,7 @@ ds_cont_iter(daos_handle_t ph, uuid_t co_uuid, cont_iter_cb_t callback, daos_handle_t coh; int rc; - rc = vos_cont_open(ph, co_uuid, &coh); + rc = VOS_CONT_OPEN(ph, co_uuid, &coh); if (rc != 0) { D_ERROR("Open container "DF_UUID" failed: rc = "DF_RC"\n", DP_UUID(co_uuid), DP_RC(rc)); @@ -2475,7 +2475,7 @@ ds_cont_iter(daos_handle_t ph, uuid_t co_uuid, cont_iter_cb_t callback, iter_fini: vos_iter_finish(iter_h); close: - vos_cont_close(coh); + VOS_CONT_CLOSE(coh); return rc; } diff --git a/src/include/daos_srv/vos.h b/src/include/daos_srv/vos.h index 3eef3f4702d..5971e972de7 100644 --- a/src/include/daos_srv/vos.h +++ b/src/include/daos_srv/vos.h @@ -592,6 +592,29 @@ vos_cont_open(daos_handle_t poh, uuid_t co_uuid, daos_handle_t *coh); int vos_cont_close(daos_handle_t coh); +#define VOS_CONT_OPEN(poh, co_uuid, coh) \ + ({ \ + int vco_rc = vos_cont_open(poh, co_uuid, coh); \ + if (vco_rc != 0) \ + D_ERROR("open vos container " DF_UUID ": " DF_RC "\n", DP_UUID(co_uuid), \ + DP_RC(vco_rc)); \ + else \ + D_INFO("open vos container " DF_UUID ": coh=" DF_X64 "\n", \ + DP_UUID(co_uuid), (coh)->cookie); \ + vco_rc; \ + }) + +#define VOS_CONT_CLOSE(coh) \ + ({ \ + int vcc_rc = vos_cont_close(coh); \ + if (vcc_rc != 0) \ + D_ERROR("close vos container " DF_X64 ": " DF_RC "\n", (coh).cookie, \ + DP_RC(vcc_rc)); \ + else \ + D_INFO("close vos container " DF_X64 "\n", (coh).cookie); \ + vcc_rc; \ + }) + /** * Query container information. * diff --git a/src/pool/srv_target.c b/src/pool/srv_target.c index f48ccf8228c..61f6e7f9369 100644 --- a/src/pool/srv_target.c +++ b/src/pool/srv_target.c @@ -2533,7 +2533,7 @@ cont_discard_cb(daos_handle_t ih, vos_iter_entry_t *entry, return rc; } - rc = vos_cont_open(iter_param->ip_hdl, entry->ie_couuid, &coh); + rc = VOS_CONT_OPEN(iter_param->ip_hdl, entry->ie_couuid, &coh); if (rc != 0) { D_ERROR("Open container "DF_UUID" failed: "DF_RC"\n", DP_UUID(entry->ie_couuid), DP_RC(rc)); @@ -2562,7 +2562,7 @@ cont_discard_cb(daos_handle_t ih, vos_iter_entry_t *entry, } while (1); d_backoff_seq_fini(&backoff_seq); - vos_cont_close(coh); + VOS_CONT_CLOSE(coh); D_DEBUG(DB_TRACE, DF_UUID"/"DF_UUID" discard cont done: "DF_RC"\n", DP_UUID(arg->tgt_discard->pool_uuid), DP_UUID(entry->ie_couuid), DP_RC(rc)); diff --git a/src/rebuild/scan.c b/src/rebuild/scan.c index a13826fd91e..56f707105d3 100644 --- a/src/rebuild/scan.c +++ b/src/rebuild/scan.c @@ -828,7 +828,7 @@ rebuild_container_scan_cb(daos_handle_t ih, vos_iter_entry_t *entry, return 0; } - rc = vos_cont_open(iter_param->ip_hdl, entry->ie_couuid, &coh); + rc = VOS_CONT_OPEN(iter_param->ip_hdl, entry->ie_couuid, &coh); if (rc == -DER_NONEXIST) { D_DEBUG(DB_REBUILD, DF_RB " co_uuid " DF_UUID " already destroyed\n", DP_RB_RPT(rpt), DP_UUID(arg->co_uuid)); @@ -936,7 +936,7 @@ rebuild_container_scan_cb(daos_handle_t ih, vos_iter_entry_t *entry, dtx_end(dth, NULL, rc); close: - vos_cont_close(coh); + VOS_CONT_CLOSE(coh); if (cont_child != NULL) { cont_child->sc_rebuilding = 0; diff --git a/src/tests/ftest/erasurecode/online_rebuild.yaml b/src/tests/ftest/erasurecode/online_rebuild.yaml index 74a6eb29ba5..4d62390a373 100644 --- a/src/tests/ftest/erasurecode/online_rebuild.yaml +++ b/src/tests/ftest/erasurecode/online_rebuild.yaml @@ -24,6 +24,9 @@ server_config: fabric_iface: ib0 fabric_iface_port: 31416 log_file: daos_server0.log + log_mask: DEBUG,MEM=ERR + env_vars: + - DD_MASK=mgmt,md,rebuild storage: auto 1: pinned_numa_node: 1 @@ -31,6 +34,9 @@ server_config: fabric_iface: ib1 fabric_iface_port: 31517 log_file: daos_server1.log + log_mask: DEBUG,MEM=ERR + env_vars: + - DD_MASK=mgmt,md,rebuild storage: auto pool: size: 93%