Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DAOS-16466 misc: Backport fixes (#15045) #15139

Merged
merged 5 commits into from
Sep 20, 2024
Merged
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
6 changes: 3 additions & 3 deletions src/dtx/dtx_rpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ static int
dtx_req_send(struct dtx_req_rec *drr, daos_epoch_t epoch)
{
struct dtx_req_args *dra = drr->drr_parent;
crt_rpc_t *req;
crt_rpc_t *req = NULL;
crt_endpoint_t tgt_ep;
crt_opcode_t opc;
struct dtx_in *din = NULL;
Expand Down Expand Up @@ -282,12 +282,12 @@ dtx_req_send(struct dtx_req_rec *drr, daos_epoch_t epoch)
}

rc = crt_req_send(req, dtx_req_cb, drr);
/* CAUTION: req and din may have been freed. */
}

DL_CDEBUG(rc != 0, DLOG_ERR, DB_TRACE, rc,
"DTX req for opc %x to %d/%d (req %p future %p) sent epoch "DF_X64,
dra->dra_opc, drr->drr_rank, drr->drr_tag, req, dra->dra_future,
din != NULL ? din->di_epoch : 0);
dra->dra_opc, drr->drr_rank, drr->drr_tag, req, dra->dra_future, epoch);

if (rc != 0 && drr->drr_comp == 0) {
drr->drr_comp = 1;
Expand Down
4 changes: 2 additions & 2 deletions src/engine/server_iv.c
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ ivc_on_get(crt_iv_namespace_t ivns, crt_iv_key_t *iv_key,
struct ds_iv_class *class;
struct ds_iv_key key;
struct iv_priv_entry *priv_entry;
void *entry_priv_val;
void *entry_priv_val = NULL;
bool alloc_entry = false;
int rc;

Expand Down Expand Up @@ -978,7 +978,7 @@ ds_iv_done(crt_iv_namespace_t ivns, uint32_t class_id,
iv_value->sg_iovs[0].iov_len);
}

ABT_future_set(cb_info->future, &rc);
ABT_future_set(cb_info->future, NULL);
return ret;
}

Expand Down
6 changes: 3 additions & 3 deletions src/mgmt/cli_mgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -1367,8 +1367,8 @@ dc_mgmt_pool_list(tse_task_t *task)
rc = daos_rpc_send_wait(rpc);
if (rc != 0) {
DL_ERROR(rc, "rpc send failed");
crt_req_decref(rpc);
wipe_cred_iov(&in->pli_cred);
crt_req_decref(rpc);
goto rechoose;
}

Expand All @@ -1377,8 +1377,8 @@ dc_mgmt_pool_list(tse_task_t *task)

rc = rsvc_client_complete_rpc(&ms_client, &ep, rc, out->plo_op.mo_rc, &out->plo_op.mo_hint);
if (rc == RSVC_CLIENT_RECHOOSE) {
crt_req_decref(rpc);
wipe_cred_iov(&in->pli_cred);
crt_req_decref(rpc);
goto rechoose;
}

Expand Down Expand Up @@ -1430,8 +1430,8 @@ dc_mgmt_pool_list(tse_task_t *task)
if (rc != 0)
DL_ERROR(rc, "failed to list pools");

crt_req_decref(rpc);
wipe_cred_iov(&in->pli_cred);
crt_req_decref(rpc);
out_client:
rsvc_client_fini(&ms_client);
out_grp:
Expand Down
8 changes: 5 additions & 3 deletions src/object/cli_ec.c
Original file line number Diff line number Diff line change
Expand Up @@ -1408,13 +1408,15 @@ obj_ec_singv_split(daos_unit_oid_t oid, uint16_t layout_ver, struct daos_oclass_
{
uint64_t c_bytes = obj_ec_singv_cell_bytes(iod_size, oca);
uint32_t tgt_off = obj_ec_shard_off_by_layout_ver(layout_ver, dkey_hash, oca, oid.id_shard);
uint64_t tgt_size = min(c_bytes, iod_size - tgt_off * c_bytes);
char *data = sgl->sg_iovs[0].iov_buf;

D_ASSERT(iod_size != DAOS_REC_ANY);
D_ASSERTF(iod_size != DAOS_REC_ANY && iod_size == sgl->sg_iovs[0].iov_len,
DF_U64 " == %zu\n", iod_size, sgl->sg_iovs[0].iov_len);
if (tgt_off > 0)
memmove(data, data + tgt_off * c_bytes, c_bytes);
memmove(data, data + tgt_off * c_bytes, tgt_size);

sgl->sg_iovs[0].iov_len = c_bytes;
sgl->sg_iovs[0].iov_len = tgt_size;
return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion src/object/tests/srv_checksum_tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -1275,7 +1275,7 @@ fetch_with_hole7(void **state)
.layout = {
{.data = "ABCDEFGHIJKLM", .sel = {1, 2}, .ful = {1, 13} },
{.data = "", .sel = {3, 7}, .ful = {3, 7}, .is_hole = true},
{.data = "HIJKLM", .sel = {8, 13}, .ful = {1, 13} },
{.data = "HIJKLM", .sel = {8, 13}, .ful = {8, 13} },
{.data = NULL}
}
});
Expand Down
6 changes: 2 additions & 4 deletions src/pool/srv_iv.c
Original file line number Diff line number Diff line change
Expand Up @@ -1222,8 +1222,7 @@ pool_iv_update(struct ds_iv_ns *ns, int class_id, uuid_t key_uuid,
}

int
ds_pool_iv_map_update(struct ds_pool *pool, struct pool_buf *buf,
uint32_t map_ver)
ds_pool_iv_map_update(struct ds_pool *pool, struct pool_buf *buf, uint32_t map_ver)
{
struct pool_iv_entry *iv_entry;
uint32_t iv_entry_size;
Expand All @@ -1240,8 +1239,7 @@ ds_pool_iv_map_update(struct ds_pool *pool, struct pool_buf *buf,
return -DER_NOMEM;

crt_group_rank(pool->sp_group, &iv_entry->piv_map.piv_master_rank);
iv_entry->piv_map.piv_pool_map_ver =
buf == NULL ? 0 : pool->sp_map_version;
iv_entry->piv_map.piv_pool_map_ver = buf == NULL ? 0 : map_ver;
if (buf != NULL)
memcpy(&iv_entry->piv_map.piv_pool_buf, buf,
pool_buf_size(buf->pb_nr));
Expand Down
6 changes: 3 additions & 3 deletions src/utils/ddb/tests/ddb_vos_tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ get_dkey_from_idx_tests(void **state)
assert_success(dv_get_dkey(coh, uoid, 0, &dkey));
i = 1;
while (SUCCESS(dv_get_dkey(coh, uoid, i, &dkey2))) {
assert_string_not_equal(dkey.iov_buf, dkey2.iov_buf);
assert_key_not_equal(dkey, dkey2);
i++;
daos_iov_free(&dkey2);
}
Expand Down Expand Up @@ -330,8 +330,8 @@ get_akey_from_idx_tests(void **state)

assert_success(dv_get_akey(coh, uoid, &dkey, 0, &akey));
i = 1;
while (SUCCESS(dv_get_dkey(coh, uoid, i, &akey2))) {
assert_string_not_equal(akey.iov_buf, akey2.iov_buf);
while (SUCCESS(dv_get_akey(coh, uoid, &dkey, i, &akey2))) {
assert_key_not_equal(akey, akey2);
i++;
daos_iov_free(&akey2);
}
Expand Down
2 changes: 1 addition & 1 deletion src/vos/tests/evt_ctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1770,7 +1770,7 @@ insert_val(struct test_arg *arg, daos_handle_t toh, daos_epoch_t epoch, uint64_t

memset(&entry.ei_csum, 0, sizeof(entry.ei_csum));

rc = bio_alloc_init(arg->ta_utx, &entry.ei_addr, &data, length);
rc = bio_alloc_init(arg->ta_utx, &entry.ei_addr, data, length);
if (rc != 0)
return rc;

Expand Down
2 changes: 1 addition & 1 deletion src/vos/tests/vts_pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1968,7 +1968,7 @@ many_keys(void **state)
assert_rc_equal(rc, 0);

rex.rx_idx = 0;
rex.rx_nr = sizeof(w) - 1;
rex.rx_nr = strlen(w);

iod.iod_type = DAOS_IOD_ARRAY;
iod.iod_size = 1;
Expand Down
Loading