Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions src/container/srv_target.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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);
Expand All @@ -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);
}

Expand Down Expand Up @@ -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));
Expand All @@ -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:
Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -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;
}

Expand Down
23 changes: 23 additions & 0 deletions src/include/daos_srv/vos.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down
4 changes: 2 additions & 2 deletions src/pool/srv_target.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down Expand Up @@ -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));
Expand Down
4 changes: 2 additions & 2 deletions src/rebuild/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down Expand Up @@ -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;
Expand Down
6 changes: 6 additions & 0 deletions src/tests/ftest/erasurecode/online_rebuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,19 @@ 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
nr_xs_helpers: 1
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%
Expand Down