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-7446 test: Run container/filesystem copy under fault injection. #5655

Merged
merged 28 commits into from
Jun 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
b971e4e
??? test: Run container/filesystem copy under fault injection.
ashleypittman May 6, 2021
93bec3b
Fix three of the errors, and disable some of the checks
ashleypittman May 6, 2021
68f9ebe
fix daos_hdlr errors
May 6, 2021
f956599
Update dfs logging.
ashleypittman May 12, 2021
7e4ddef
Merge branch 'master' into fs-copy-fi
ashleypittman May 12, 2021
468740b
Merge branch 'master' into fs-copy-fi
ashleypittman May 13, 2021
778aca7
Fix one more dfs warning.
ashleypittman May 13, 2021
855a19f
Fix new warnings and checkpatch issues.
ashleypittman May 13, 2021
48ba595
Back out roots change.
ashleypittman May 13, 2021
de1b7a4
Revert "Back out roots change."
ashleypittman May 13, 2021
7be2856
Fix crash on allocation failure.
ashleypittman May 14, 2021
dc48739
Tidy up test code for landing.
ashleypittman May 14, 2021
167d98b
Fix a types issue.
ashleypittman May 14, 2021
28a20b1
Merge branch 'master' into fs-copy-fi
ashleypittman May 19, 2021
47a3f9b
Take on fix from Dmitry
ashleypittman May 19, 2021
3638c7d
Merge branch 'master' into fs-copy-fi
ashleypittman May 20, 2021
6236a24
Merge branch 'master' into fs-copy-fi
ashleypittman May 20, 2021
b8e3f5d
Back out part of the change.
ashleypittman May 20, 2021
19f643d
Fix quote.
ashleypittman May 20, 2021
b84120b
Fix previous commits.
ashleypittman May 20, 2021
d4711b7
Merge branch 'master' into fs-copy-fi
ashleypittman May 23, 2021
882f5f4
Fix bad merge.
ashleypittman May 24, 2021
6d037dd
Merge branch 'master' into fs-copy-fi
ashleypittman Jun 8, 2021
3242ab9
Merge branch 'master' into fs-copy-fi
ashleypittman Jun 9, 2021
70edb45
Disable test, so we can land fixes.
ashleypittman Jun 9, 2021
c449227
Update to new API.
ashleypittman Jun 10, 2021
1f2a7dd
Merge branch 'master' into fs-copy-fi
ashleypittman Jun 14, 2021
be5eb91
Merge branch 'master' into fs-copy-fi
ashleypittman Jun 16, 2021
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
45 changes: 17 additions & 28 deletions src/client/array/dc_array.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,8 @@ free_io_params_cb(tse_task_t *task, void *data)
daos_recx_free(current->iom.iom_recxs);
current->iom.iom_recxs = NULL;
}
if (current->iod.iod_recxs)
D_FREE(current->iod.iod_recxs);
if (!current->user_sgl_used && current->sgl.sg_iovs)
D_FREE(current->iod.iod_recxs);
if (!current->user_sgl_used)
D_FREE(current->sgl.sg_iovs);

io_list = current->next;
Expand Down Expand Up @@ -819,7 +818,6 @@ dc_array_open(tse_task_t *task)
if (params == NULL)
D_GOTO(err_put2, rc = -DER_NOMEM);


rc = tse_task_register_comp_cb(task, free_md_params_cb, &params,
sizeof(params));
if (rc != 0) {
Expand Down Expand Up @@ -1593,9 +1591,9 @@ dc_array_io(daos_handle_t array_oh, daos_handle_t th,
/** add another element to recxs */
D_REALLOC_ARRAY(new_recxs, iod->iod_recxs,
iod->iod_nr, iod->iod_nr + 1);
if (new_recxs == NULL) {
if (new_recxs == NULL)
D_GOTO(err_stask, rc = -DER_NOMEM);
}

iod->iod_nr++;
iod->iod_recxs = new_recxs;

Expand Down Expand Up @@ -1735,8 +1733,8 @@ dc_array_io(daos_handle_t array_oh, daos_handle_t th,
tse_task2sched(task),
0, NULL, &io_task);
if (rc != 0) {
D_ERROR("Update dkey "DF_U64" failed (%d)\n",
params->dkey_val, rc);
D_ERROR("Update dkey "DF_U64" failed "DF_RC"\n",
params->dkey_val, DP_RC(rc));
daltonbohning marked this conversation as resolved.
Show resolved Hide resolved
D_GOTO(err_iotask, rc);
}
io_arg = daos_task_get_args(io_task);
Expand Down Expand Up @@ -1969,10 +1967,8 @@ dc_array_get_size(tse_task_t *task)
err_query_task:
tse_task_complete(query_task, rc);
err_task:
if (kqp)
D_FREE(kqp);
if (query_task)
D_FREE(query_task);
D_FREE(kqp);
D_FREE(query_task);
if (array)
array_decref(array);
tse_task_complete(task, rc);
Expand Down Expand Up @@ -2003,8 +1999,7 @@ free_set_size_cb(tse_task_t *task, void *data)
{
struct set_size_props *props = *((struct set_size_props **)data);

if (props->val)
D_FREE(props->val);
D_FREE(props->val);
if (props->array)
array_decref(props->array);
D_FREE(props);
Expand Down Expand Up @@ -2061,8 +2056,7 @@ punch_key(daos_handle_t oh, daos_handle_t th, daos_size_t dkey_val,

return rc;
err:
if (params)
D_FREE(params);
D_FREE(params);
if (io_task)
tse_task_complete(io_task, rc);
return rc;
Expand Down Expand Up @@ -2132,8 +2126,7 @@ punch_extent(daos_handle_t oh, daos_handle_t th, daos_size_t dkey_val,

return rc;
err:
if (params)
D_FREE(params);
D_FREE(params);
if (io_task)
tse_task_complete(io_task, rc);
return rc;
Expand Down Expand Up @@ -2220,8 +2213,7 @@ check_record_cb(tse_task_t *task, void *data)
if (io_task)
tse_task_complete(io_task, rc);
out:
if (params)
D_FREE(params);
D_FREE(params);
return rc;
}

Expand Down Expand Up @@ -2291,8 +2283,7 @@ check_record(daos_handle_t oh, daos_handle_t th, daos_size_t dkey_val,

return rc;
err:
if (params)
D_FREE(params);
D_FREE(params);
if (io_task)
tse_task_complete(io_task, rc);
return rc;
Expand Down Expand Up @@ -2367,8 +2358,7 @@ add_record(daos_handle_t oh, daos_handle_t th, struct set_size_props *props)

return rc;
err:
if (params)
D_FREE(params);
D_FREE(params);
if (io_task)
tse_task_complete(io_task, rc);
return rc;
Expand Down Expand Up @@ -2497,8 +2487,8 @@ dc_array_set_size(tse_task_t *task)
num_records = array->chunk_size;
record_i = 0;
} else {
rc = compute_dkey(array, args->size-1, &num_records, &record_i,
&dkey_val);
rc = compute_dkey(array, args->size - 1, &num_records,
&record_i, &dkey_val);
if (rc) {
D_ERROR("Failed to compute dkey\n");
D_GOTO(err_task, rc);
Expand Down Expand Up @@ -2570,8 +2560,7 @@ dc_array_set_size(tse_task_t *task)
err_enum_task:
tse_task_complete(enum_task, rc);
err_task:
if (set_size_props)
D_FREE(set_size_props);
D_FREE(set_size_props);
if (array)
array_decref(array);
tse_task_complete(task, rc);
Expand Down
46 changes: 24 additions & 22 deletions src/client/dfs/dfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,8 @@ insert_entry(daos_handle_t oh, daos_handle_t th, const char *name, size_t len,
if (rc) {
/** don't log error if conditional failed */
if (rc != -DER_EXIST)
D_ERROR("Failed to insert entry %s (%d)\n", name, rc);
D_ERROR("Failed to insert entry %s, "DF_RC"\n",
name, DP_RC(rc));
return daos_der2errno(rc);
}

Expand Down Expand Up @@ -881,7 +882,8 @@ open_file(dfs_t *dfs, daos_handle_t th, dfs_obj_t *parent, int flags,
rc = daos_array_open_with_attr(dfs->coh, entry->oid, th, daos_mode, 1,
entry->chunk_size, &file->oh, NULL);
if (rc != 0) {
D_ERROR("daos_array_open_with_attr() failed (%d)\n", rc);
D_ERROR("daos_array_open_with_attr() failed, "DF_RC"\n",
DP_RC(rc));
return daos_der2errno(rc);
}

Expand Down Expand Up @@ -932,7 +934,7 @@ create_dir(dfs_t *dfs, dfs_obj_t *parent, daos_oclass_id_t cid, dfs_obj_t *dir)
/** Open the Object - local operation */
rc = daos_obj_open(dfs->coh, dir->oid, DAOS_OO_RW, &dir->oh, NULL);
if (rc) {
D_ERROR("daos_obj_open() Failed (%d)\n", rc);
D_ERROR("daos_obj_open() Failed, "DF_RC"\n", DP_RC(rc));
return daos_der2errno(rc);
}

Expand Down Expand Up @@ -999,7 +1001,7 @@ open_dir(dfs_t *dfs, daos_handle_t th, dfs_obj_t *parent, int flags,

rc = daos_obj_open(dfs->coh, entry->oid, daos_mode, &dir->oh, NULL);
if (rc) {
D_ERROR("daos_obj_open() Failed (%d)\n", rc);
D_ERROR("daos_obj_open() Failed, "DF_RC"\n", DP_RC(rc));
return daos_der2errno(rc);
}
dir->mode = entry->mode;
Expand Down Expand Up @@ -1074,9 +1076,8 @@ set_daos_iod(bool create, daos_iod_t *iod, char *buf, size_t size)
iod->iod_recxs = NULL;
iod->iod_type = DAOS_IOD_SINGLE;

if (create) {
if (create)
iod->iod_size = size;
}
}

static void
Expand Down Expand Up @@ -1114,7 +1115,7 @@ open_sb(daos_handle_t coh, bool create, daos_obj_id_t super_oid,
rc = daos_obj_open(coh, super_oid, create ? DAOS_OO_RW : DAOS_OO_RO,
oh, NULL);
if (rc) {
D_ERROR("daos_obj_open() Failed (%d)\n", rc);
D_ERROR("daos_obj_open() Failed, "DF_RC"\n", DP_RC(rc));
return daos_der2errno(rc);
}

Expand Down Expand Up @@ -1163,7 +1164,7 @@ open_sb(daos_handle_t coh, bool create, daos_obj_id_t super_oid,
rc = daos_obj_fetch(*oh, DAOS_TX_NONE, 0, &dkey, SB_AKEYS, iods, sgls,
NULL, NULL);
if (rc) {
D_ERROR("Failed to fetch SB info (%d)\n", rc);
D_ERROR("Failed to fetch SB info, "DF_RC"\n", DP_RC(rc));
D_GOTO(err, rc = daos_der2errno(rc));
}

Expand Down Expand Up @@ -1332,7 +1333,7 @@ dfs_cont_create(daos_handle_t poh, uuid_t co_uuid, dfs_attr_t *attr,
*/
rc = insert_entry(super_oh, DAOS_TX_NONE, "/", 1, &entry);
if (rc && rc != EEXIST) {
D_ERROR("Failed to insert root entry (%d).", rc);
D_ERROR("Failed to insert root entry, %d\n", rc);
D_GOTO(err_super, rc);
}

Expand Down Expand Up @@ -1390,10 +1391,8 @@ dfs_mount(daos_handle_t poh, daos_handle_t coh, int flags, dfs_t **_dfs)
return EINVAL;

prop = daos_prop_alloc(0);
if (prop == NULL) {
D_ERROR("Failed to allocate prop.");
if (prop == NULL)
return ENOMEM;
}

rc = daos_cont_query(coh, NULL, prop, NULL);
if (rc) {
Expand Down Expand Up @@ -1432,7 +1431,8 @@ dfs_mount(daos_handle_t poh, daos_handle_t coh, int flags, dfs_t **_dfs)
/** Set uid to nobody */
rc = daos_acl_principal_to_uid("nobody@", &dfs->uid);
if (rc) {
D_ERROR("Unable to convert owner to uid\n");
D_ERROR("Unable to convert owner to uid "DF_RC"\n",
daltonbohning marked this conversation as resolved.
Show resolved Hide resolved
DP_RC(rc));
D_GOTO(err_dfs, rc = daos_der2errno(rc));
}

Expand All @@ -1443,7 +1443,8 @@ dfs_mount(daos_handle_t poh, daos_handle_t coh, int flags, dfs_t **_dfs)
/** Set gid to nobody */
rc = daos_acl_principal_to_gid("nobody@", &dfs->gid);
if (rc) {
D_ERROR("Unable to convert owner to gid\n");
D_ERROR("Unable to convert owner to gid "DF_RC"\n",
daltonbohning marked this conversation as resolved.
Show resolved Hide resolved
DP_RC(rc));
D_GOTO(err_dfs, rc = daos_der2errno(rc));
}

Expand All @@ -1470,15 +1471,16 @@ dfs_mount(daos_handle_t poh, daos_handle_t coh, int flags, dfs_t **_dfs)
rc = open_dir(dfs, DAOS_TX_NONE, NULL, amode | S_IFDIR, 0, &root_dir,
1, &dfs->root);
if (rc) {
D_ERROR("Failed to open root object (%d)\n", rc);
D_ERROR("Failed to open root object, %d\n", rc);
D_GOTO(err_super, rc);
}

/** if RW, allocate an OID for the namespace */
if (amode == O_RDWR) {
rc = daos_cont_alloc_oids(coh, 1, &dfs->oid.lo, NULL);
if (rc) {
D_ERROR("daos_cont_alloc_oids() Failed (%d)\n", rc);
D_ERROR("daos_cont_alloc_oids() Failed, "DF_RC"\n",
DP_RC(rc));
D_GOTO(err_root, rc = daos_der2errno(rc));
}

Expand Down Expand Up @@ -2306,7 +2308,8 @@ lookup_rel_path(dfs_t *dfs, dfs_obj_t *root, const char *path, int flags,

rc = daos_obj_close(obj->oh, NULL);
if (rc) {
D_ERROR("daos_obj_close() Failed (%d)\n", rc);
D_ERROR("daos_obj_close() Failed, "DF_RC"\n",
DP_RC(rc));
D_GOTO(err_obj, rc = daos_der2errno(rc));
}

Expand Down Expand Up @@ -2446,7 +2449,7 @@ lookup_rel_path(dfs_t *dfs, dfs_obj_t *root, const char *path, int flags,
rc = daos_obj_open(dfs->coh, entry.oid, daos_mode, &obj->oh,
NULL);
if (rc) {
D_ERROR("daos_obj_open() Failed (%d)\n", rc);
D_ERROR("daos_obj_open() Failed, "DF_RC"\n", DP_RC(rc));
D_GOTO(err_obj, rc = daos_der2errno(rc));
}

Expand Down Expand Up @@ -3436,7 +3439,7 @@ dfs_write(dfs_t *dfs, dfs_obj_t *obj, d_sg_list_t *sgl, daos_off_t off,

rc = daos_array_write(obj->oh, DAOS_TX_NONE, &iod, sgl, ev);
if (rc)
D_ERROR("daos_array_write() failed (%d)\n", rc);
D_ERROR("daos_array_write() failed, "DF_RC"\n", DP_RC(rc));
daltonbohning marked this conversation as resolved.
Show resolved Hide resolved

return daos_der2errno(rc);
}
Expand Down Expand Up @@ -3737,7 +3740,7 @@ dfs_chmod(dfs_t *dfs, dfs_obj_t *parent, const char *name, mode_t mode)
rc = daos_obj_update(oh, th, DAOS_COND_DKEY_UPDATE, &dkey, 1, &iod,
&sgl, NULL);
if (rc) {
D_ERROR("Failed to update mode (rc = %d)\n", rc);
D_ERROR("Failed to update mode, "DF_RC"\n", DP_RC(rc));
D_GOTO(out, rc = daos_der2errno(rc));
}

Expand Down Expand Up @@ -3843,9 +3846,8 @@ dfs_osetattr(dfs_t *dfs, dfs_obj_t *obj, struct stat *stbuf, int flags)
flags &= ~DFS_SET_ATTR_SIZE;
}

if (flags) {
if (flags)
D_GOTO(out_obj, rc = EINVAL);
}

if (set_size) {
rc = daos_array_set_size(obj->oh, th, stbuf->st_size, NULL);
Expand Down
4 changes: 1 addition & 3 deletions src/client/dfs/duns.c
Original file line number Diff line number Diff line change
Expand Up @@ -351,10 +351,8 @@ duns_resolve_path(const char *path, struct duns_attr_t *attr)
char *saveptr, *t;

D_STRNDUP(dir, path, PATH_MAX);
if (dir == NULL) {
D_ERROR("Failed to copy path\n");
if (dir == NULL)
return ENOMEM;
}

D_DEBUG(DB_TRACE, "DUNS resolve to direct path: %s\n", dir);
t = strtok_r(dir, "/", &saveptr);
Expand Down
1 change: 1 addition & 0 deletions src/common/proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ crt_proc_daos_prop_t(crt_proc_t proc, crt_proc_op_t proc_op, daos_prop_t **data)
prop->dpp_reserv = tmp;
rc = crt_proc_prop_entries(proc, proc_op, prop);
if (rc) {
crt_proc_prop_entries(proc, CRT_PROC_FREE, prop);
D_FREE(prop->dpp_entries);
D_FREE(prop);
return rc;
Expand Down
24 changes: 10 additions & 14 deletions src/common/prop.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,12 @@ daos_prop_entry_free_value(struct daos_prop_entry *entry)
case DAOS_PROP_CO_OWNER:
case DAOS_PROP_PO_OWNER_GROUP:
case DAOS_PROP_CO_OWNER_GROUP:
if (entry->dpe_str)
D_FREE(entry->dpe_str);
D_FREE(entry->dpe_str);
break;
case DAOS_PROP_PO_ACL:
case DAOS_PROP_CO_ACL:
case DAOS_PROP_CO_ROOTS:
if (entry->dpe_val_ptr)
D_FREE(entry->dpe_val_ptr);
D_FREE(entry->dpe_val_ptr);
break;
case DAOS_PROP_PO_SVC_LIST:
if (entry->dpe_val_ptr)
Expand Down Expand Up @@ -85,7 +83,6 @@ daos_prop_fini(daos_prop_t *prop)
}

D_FREE(prop->dpp_entries);
prop->dpp_entries = NULL;
daltonbohning marked this conversation as resolved.
Show resolved Hide resolved
out:
prop->dpp_nr = 0;
}
Expand Down Expand Up @@ -718,17 +715,16 @@ int
daos_prop_entry_dup_co_roots(struct daos_prop_entry *dst,
struct daos_prop_entry *src)
{
struct daos_prop_co_roots *roots;

roots = src->dpe_val_ptr;
if (!dst->dpe_val_ptr)
D_ALLOC(dst->dpe_val_ptr, sizeof(*roots));

if (dst->dpe_val_ptr == NULL) {
D_ERROR("failed to dup roots\n");
return -DER_NOMEM;
D_ALLOC(dst->dpe_val_ptr, sizeof(struct daos_prop_co_roots));

if (dst->dpe_val_ptr == NULL)
return -DER_NOMEM;
}
memcpy(dst->dpe_val_ptr, roots, sizeof(*roots));

memcpy(dst->dpe_val_ptr,
src->dpe_val_ptr,
sizeof(struct daos_prop_co_roots));
return 0;
}

Expand Down
Loading