Skip to content

Commit

Permalink
DAOS-16251 tests: Fix EC2 use-after-scope
Browse files Browse the repository at this point in the history
Signed-off-by: Li Wei <wei.g.li@intel.com>
Required-githooks: true
  • Loading branch information
liw committed Sep 18, 2024
1 parent 3ada1c4 commit 03d1555
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/tests/suite/daos_obj_ec.c
Original file line number Diff line number Diff line change
Expand Up @@ -285,16 +285,15 @@ ec_rec_list_punch(void **state)
daos_obj_id_t oid;
int num_rec;
int i;
daos_recx_t recx;
char data[16];

if (!test_runable(arg, 6))
return;

oid = daos_test_oid_gen(arg->coh, ec_obj_class, 0, 0, arg->myrank);
ioreq_init(&req, arg->coh, oid, DAOS_IOD_ARRAY, arg);
for (i = 0; i < 100; i++) {
daos_recx_t recx;
char data[16];

/* Make dkey on different shards */
req.iod_type = DAOS_IOD_ARRAY;
recx.rx_nr = 5;
Expand All @@ -313,8 +312,6 @@ ec_rec_list_punch(void **state)

/* punch the akey */
for (i = 0; i < 100; i++) {
daos_recx_t recx;

recx.rx_nr = 5;
recx.rx_idx = i * EC_CELL_SIZE;

Expand Down Expand Up @@ -2402,7 +2399,7 @@ ec_dkey_enum_fail(void **state)
recx.rx_nr = 5;
recx.rx_idx = 0;
memset(data, 'a', 5);
insert_recxs(dkey, "a_key", 1, DAOS_TX_NONE, &recx, 1, data, 16, &req);
insert_recxs(dkey, "a_key", 1, DAOS_TX_NONE, &recx, 1, data, 5, &req);
}

print_message("iterate dkey...\n");
Expand Down

0 comments on commit 03d1555

Please sign in to comment.