Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/daos-stack/daos into grom…
Browse files Browse the repository at this point in the history
…72/pmdk-2.0.0

Required-githooks: true
  • Loading branch information
grom72 committed Nov 22, 2023
2 parents 6f7400d + 3bebffe commit 704ab22
Show file tree
Hide file tree
Showing 27 changed files with 1,207 additions and 427 deletions.
121 changes: 78 additions & 43 deletions .github/workflows/rpm-build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,8 @@ jobs:
dequoted_message: ${{ steps.dequoted_commit_message.outputs.text }}
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: false
fetch-depth: 1
ref: ${{ github.event.pull_request.head.sha }}
- name: Import Commit Message
id: commit_message
Expand Down Expand Up @@ -229,10 +227,8 @@ jobs:
echo "STAGE_NAME=Build RPM on $DISTRO_NAME $DISTRO_VERSION" >> $GITHUB_ENV
echo "FVERSION=$FVERSION" >> $GITHUB_ENV
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 500
ref: ${{ github.event.pull_request.head.sha }}
- name: Build RPM Docker image
id: build-rpm-docker-image
Expand Down Expand Up @@ -315,35 +311,49 @@ jobs:
steps:
- name: Import commit pragmas
uses: ./.github/actions/import-commit-pragmas
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Calculate Functional Testing Matrix
id: matrix
run: | # do not use the non-| format for this script
l=()
trap 'echo "text=[$(IFS=","; echo "${l[*]}")]" >> $GITHUB_OUTPUT' EXIT
if ${CP_SKIP_FUNC_TEST:-false}; then
exit 0
fi
. ci/gha_functions.sh
set -eu
# it might seem tempting to factor in the result of the build for this
# distro here and not include a failed build in the test matrix
# distro here and not include a failed build in the test matrix but
# the problem with that is that if/when the user asks GHA to rebuild
# all failed jobs and a previously failed RPM job is successful, the
# test matrix won't include testing it since it was calculated and was
# successful on the previous run without the failed build stage in it
if ! ${CP_SKIP_BUILD_EL8_RPM:-false} &&
! ${CP_SKIP_FUNC_TEST_EL8:-false}; then
# it would definitely be nicer to get these into the environment
# as unquoted strings so that we didn't have to double quote here
l+=('"el8"')
l=()
trap 'echo "text=[$(IFS=","; echo "${l[*]}")]" >> $GITHUB_OUTPUT' EXIT
if ${CP_SKIP_FUNC_TEST:-false}; then
exit 0
fi
if ! ${CP_SKIP_BUILD_EL9_RPM:-false} &&
! ${CP_SKIP_FUNC_TEST_EL9:-false}; then
l+=('"el9"')
if ! cd src/tests/ftest; then
echo "src/tests/ftest doesn't exist."
echo "Could not determine if tests exist for this stage, assuming they do."
exit 0
fi
if ${{ github.event_name == 'push' }} ||
(${{ github.event_name == 'pull_request' }} &&
! ${CP_SKIP_BUILD_LEAP15_RPM:-false} &&
! ${CP_SKIP_FUNC_TEST_LEAP15:-true}); then
l+=('"leap15"')
if ./launch.py --list "$(get_test_tags "-hw")"; then
if ! ${CP_SKIP_BUILD_EL8_RPM:-false} &&
! ${CP_SKIP_FUNC_TEST_EL8:-false}; then
# it would definitely be nicer to get these into the environment
# as unquoted strings so that we didn't have to double quote here
l+=('"el8"')
fi
if ! ${CP_SKIP_BUILD_EL9_RPM:-false} &&
! ${CP_SKIP_FUNC_TEST_EL9:-false}; then
l+=('"el9"')
fi
if ${{ github.event_name == 'push' }} ||
(${{ github.event_name == 'pull_request' }} &&
! ${CP_SKIP_BUILD_LEAP15_RPM:-false} &&
! ${CP_SKIP_FUNC_TEST_LEAP15:-true}); then
l+=('"leap15"')
fi
fi
Functional:
Expand Down Expand Up @@ -400,6 +410,7 @@ jobs:
env
STAGE_TAGS="-hw"
FTEST_ARG=""
INST_RPMS="daos-client daos-tests daos-server daos-serialize daos-tests-internal"
case "${{ matrix.distro }}" in
'el8')
CHROOT_NAME="rocky+epel-8-x86_64"
Expand Down Expand Up @@ -456,10 +467,9 @@ jobs:
echo "${PROV_DISTRO_VERSION_MAJOR:-$DISTRO_VERSION_MAJOR}_LOCAL_REPO=not_used" >> \
$GITHUB_ENV
echo "LABEL=$LABEL" >> $GITHUB_ENV
echo -n "INST_RPMS=daos-client daos-tests daos-server daos-serialize" >> $GITHUB_ENV
echo -n " daos-tests-internal" >> $GITHUB_ENV
echo "INST_RPMS=$INST_RPMS" >> $GITHUB_ENV
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 500
Expand Down Expand Up @@ -532,34 +542,48 @@ jobs:
steps:
- name: Import commit pragmas
uses: ./.github/actions/import-commit-pragmas
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Calculate Functional Testing Matrix
id: matrix
run: | # do not use the non-| format for this script
. ci/gha_functions.sh
set -eu
l=()
trap 'echo "text=[$(IFS=","; echo "${l[*]}")]" >> $GITHUB_OUTPUT' EXIT
if ${CP_SKIP_FUNC_HW_TEST:-false}; then
exit 0
fi
# it might seem tempting to factor in the result of the build for this
# distro here and not include a failed build in the test matrix
# distro here and not include a failed build in the test matrix but
# the problem with that is that if/when the user asks GHA to rebuild
# all faiiled jobs and a previously failed RPM job is successful, the
# test matrix won't include testing it since it was calculated and was
# successful on the previous run without the failed build stage in it
if ! "${CP_SKIP_FUNC_HW_TEST_LARGE:-false}"; then
l=()
trap 'echo "text=[$(IFS=","; echo "${l[*]}")]" >> $GITHUB_OUTPUT' EXIT
if ${CP_SKIP_FUNC_HW_TEST:-false}; then
exit 0
fi
if ! cd src/tests/ftest; then
echo "src/tests/ftest doesn't exist."
echo "Could not determine if tests exist for this stage, assuming they do."
exit 0
fi
if ! "${CP_SKIP_FUNC_HW_TEST_LARGE:-false}" &&
./launch.py --list "$(get_test_tags "hw,large,-provider")"; then
# it would definitely be nicer to get these into the environment
# as unquoted strings so that we didn't have to double quote here
l+=('"Large"')
fi
if ! ${CP_SKIP_FUNC_HW_TEST_MEDIUM:-false}; then
if ! ${CP_SKIP_FUNC_HW_TEST_MEDIUM:-false} &&
./launch.py --list "$(get_test_tags "hw,medium,-provider")"; then
l+=('"Medium"')
fi
if ! ${CP_SKIP_FUNC_HW_TEST_MEDIUM_VERBS_PROVIDER:-false}; then
if ! ${CP_SKIP_FUNC_HW_TEST_MEDIUM_VERBS_PROVIDER:-false} &&
./launch.py --list "$(get_test_tags "hw,medium,provider")"; then
l+=('"Medium Verbs Provider"')
fi
if ${{ github.event_name == 'push' }} &&
! ${CP_SKIP_FUNC_HW_TEST_MEDIUM_UCX_PROVIDER:-false}; then
! ${CP_SKIP_FUNC_HW_TEST_MEDIUM_UCX_PROVIDER:-false} &&
./launch.py --list "$(get_test_tags "hw,medium,provider")"; then
l+=('"Medium UCX Provider"')
fi
Expand All @@ -581,7 +605,7 @@ jobs:
(needs.Build-RPM.result == 'success' ||
needs.Build-RPM.result == 'skipped') &&
(needs.Functional.result == 'success' ||
needs.Functional.result == 'skipped')
needs.Functional.result == 'skipped')
env:
CONFIG_POWER_ONLY: false
PRAGMA_SUFFIX: -vm
Expand Down Expand Up @@ -614,6 +638,7 @@ jobs:
run: |
STAGE_TAGS="hw"
FTEST_ARG="--nvme=auto:-3DNAND"
INST_RPMS="daos-client daos-tests daos-server daos-serialize daos-tests-internal"
CHROOT_NAME="rocky+epel-8-x86_64"
DISTRO_NAME="EL"
DISTRO_NAME_UPPER="EL"
Expand All @@ -634,8 +659,19 @@ jobs:
STAGE_TAGS+=",large"
SIZE="LARGE"
fi
if [[ "${{ matrix.stage }}" = *\ Prvider ]]; then
if [[ "${{ matrix.stage }}" = *\ Provider ]]; then
STAGE_TAGS+=",provider"
if [[ "${{ matrix.stage }}" = *\ Verbs\ * ]]; then
FTEST_ARG+=' --provider ofi+verbs'
elif [[ "${{ matrix.stage }}" = *\ UCX\ * ]]; then
FTEST_ARG+=' --provider ucx+dc_x'
INST_RPMS+=' mercury-ucx'
elif [[ "${{ matrix.stage }}" = *\ TCP\ * ]]; then
FTEST_ARG+=' --provider ofi+tcp'
else
echo "Unknown provider in ${{ matrix.stage }}"
exit 1
fi
else
STAGE_TAGS+=",-provider"
fi
Expand All @@ -652,11 +688,10 @@ jobs:
echo "${PROV_DISTRO_VERSION_MAJOR:-$DISTRO_VERSION_MAJOR}_LOCAL_REPO=not_used" >> \
$GITHUB_ENV
echo "LABEL=$LABEL" >> $GITHUB_ENV
echo -n "INST_RPMS=daos-client daos-tests daos-server daos-serialize" >> $GITHUB_ENV
echo " daos-tests-internal" >> $GITHUB_ENV
echo "INST_RPMS=$INST_RPMS" >> $GITHUB_ENV
echo "SIZE=$SIZE" >> $GITHUB_ENV
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 500
Expand Down
4 changes: 2 additions & 2 deletions src/cart/crt_rpc.h
Original file line number Diff line number Diff line change
Expand Up @@ -216,11 +216,11 @@ crt_rpc_unlock(struct crt_rpc_priv *rpc_priv)
D_MUTEX_UNLOCK(&rpc_priv->crp_mutex);
}

#define CRT_PROTO_INTERNAL_VERSION 5
#define CRT_PROTO_INTERNAL_VERSION 4
#define CRT_PROTO_FI_VERSION 3
#define CRT_PROTO_ST_VERSION 1
#define CRT_PROTO_CTL_VERSION 1
#define CRT_PROTO_IV_VERSION 1
#define CRT_PROTO_IV_VERSION 2

/* LIST of internal RPCS in form of:
* OPCODE, flags, FMT, handler, corpc_hdlr,
Expand Down
2 changes: 1 addition & 1 deletion src/client/dfuse/dfuse.h
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ struct fuse_lowlevel_ops dfuse_ops;
do { \
int __rc; \
double timeout = 0; \
if (atomic_load_relaxed(&(ie)->ie_open_count) == 0) { \
if (atomic_load_relaxed(&(ie)->ie_il_count) == 0) { \
timeout = (ie)->ie_dfs->dfc_attr_timeout; \
dfuse_mcache_set_time(ie); \
} \
Expand Down
17 changes: 17 additions & 0 deletions src/client/dfuse/dfuse_fuseops.c
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,11 @@ df_ll_symlink(fuse_req_t req, const char *link, fuse_ino_t parent, const char *n
DFUSE_REPLY_ERR_RAW(dfuse_info, req, rc);
}

/* Do not allow security xattrs to be set or read, see DAOS-14639 */
#define XATTR_SEC "security."
/* Do not allow either system.posix_acl_default or system.posix_acl_access */
#define XATTR_P_ACL "system.posix_acl"

void
df_ll_setxattr(fuse_req_t req, fuse_ino_t ino, const char *name, const char *value, size_t size,
int flags)
Expand All @@ -385,6 +390,12 @@ df_ll_setxattr(fuse_req_t req, fuse_ino_t ino, const char *name, const char *val
D_GOTO(err, rc = EPERM);
}

if (strncmp(name, XATTR_SEC, sizeof(XATTR_SEC) - 1) == 0)
D_GOTO(err, rc = ENOTSUP);

if (strncmp(name, XATTR_P_ACL, sizeof(XATTR_P_ACL) - 1) == 0)
D_GOTO(err, rc = ENOTSUP);

inode = dfuse_inode_lookup_nf(dfuse_info, ino);

if (!inode->ie_dfs->dfs_ops->setxattr)
Expand All @@ -406,6 +417,12 @@ df_ll_getxattr(fuse_req_t req, fuse_ino_t ino, const char *name, size_t size)
struct dfuse_inode_entry *inode;
int rc;

if (strncmp(name, XATTR_SEC, sizeof(XATTR_SEC) - 1) == 0)
D_GOTO(err, rc = ENODATA);

if (strncmp(name, XATTR_P_ACL, sizeof(XATTR_P_ACL) - 1) == 0)
D_GOTO(err, rc = ENODATA);

inode = dfuse_inode_lookup_nf(dfuse_info, ino);

if (!inode->ie_dfs->dfs_ops->getxattr)
Expand Down
18 changes: 18 additions & 0 deletions src/client/pydaos/raw/conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
import ctypes
import uuid

from .. import DAOS_MAGIC, pydaos_shim


def c_uuid_to_str(cuuid):
""" utility function to convert a C uuid into a standard string format """
Expand All @@ -29,3 +31,19 @@ def str_to_c_uuid(uuidstr):
cuuid = (ctypes.c_ubyte * 16)()
c_uuid(puuid, cuuid)
return cuuid


def c_err_to_str(err_num):
""" Utility function to convert C error code to its string id.
Args:
err_num (int): C error code.
Returns:
str: String identifying a C error code.
"""
err_str = pydaos_shim.err_to_str(DAOS_MAGIC, err_num)
if err_str:
return err_str
return str(err_num)
4 changes: 1 addition & 3 deletions src/container/srv_target.c
Original file line number Diff line number Diff line change
Expand Up @@ -835,8 +835,6 @@ ds_cont_child_stop_all(struct ds_pool_child *pool_child)
DP_UUID(pool_child->spc_uuid),
dss_get_module_info()->dmi_tgt_id);

D_ASSERT(d_list_empty(&pool_child->spc_list));

cont_list = &pool_child->spc_cont_list;
while (!d_list_empty(cont_list)) {
cont_child = d_list_entry(cont_list->next,
Expand Down Expand Up @@ -1532,7 +1530,7 @@ ds_cont_local_open(uuid_t pool_uuid, uuid_t cont_hdl_uuid, uuid_t cont_uuid,
if (ddra == NULL)
D_GOTO(err_dtx, rc = -DER_NOMEM);

ddra->pool = ds_pool_child_get(hdl->sch_cont->sc_pool);
ddra->pool = ds_pool_child_lookup(hdl->sch_cont->sc_pool->spc_uuid);
uuid_copy(ddra->co_uuid, cont_uuid);
rc = dss_ult_create(ds_dtx_resync, ddra, DSS_XS_SELF,
0, 0, NULL);
Expand Down
20 changes: 18 additions & 2 deletions src/include/daos_srv/pool.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ struct ds_pool {
ABT_cond sp_fetch_hdls_cond;
ABT_cond sp_fetch_hdls_done_cond;
struct ds_iv_ns *sp_iv_ns;
uint32_t *sp_states; /* pool child state array */

/* structure related to EC aggregate epoch query */
d_list_t sp_ec_ephs_list;
Expand Down Expand Up @@ -128,6 +129,13 @@ struct ds_pool_hdl {
struct ds_pool_hdl *ds_pool_hdl_lookup(const uuid_t uuid);
void ds_pool_hdl_put(struct ds_pool_hdl *hdl);

enum pool_child_state {
POOL_CHILD_NEW = 0,
POOL_CHILD_STARTING,
POOL_CHILD_STARTED,
POOL_CHILD_STOPPING,
};

/*
* Per-thread pool object
*
Expand Down Expand Up @@ -160,8 +168,9 @@ struct ds_pool_child {
int spc_ref;
ABT_eventual spc_ref_eventual;

uint64_t spc_discard_done:1;
uint32_t spc_discard_done:1;
uint32_t spc_reint_mode;
uint32_t *spc_state; /* Pointer to ds_pool->sp_states[i] */
/**
* Per-pool per-module metrics, see ${modname}_pool_metrics for the
* actual structure. Initialized only for modules that specified a
Expand All @@ -182,9 +191,16 @@ struct ds_pool_svc_op_val {
char ov_resvd[60];
};

/* Find ds_pool_child in cache, hold one reference */
struct ds_pool_child *ds_pool_child_lookup(const uuid_t uuid);
struct ds_pool_child *ds_pool_child_get(struct ds_pool_child *child);
/* Put the reference held by ds_pool_child_lookup() */
void ds_pool_child_put(struct ds_pool_child *child);
/* Start ds_pool child */
int ds_pool_child_start(uuid_t pool_uuid);
/* Stop ds_pool_child */
int ds_pool_child_stop(uuid_t pool_uuid);
/* Query pool child state */
uint32_t ds_pool_child_state(struct ds_pool *pool, uint32_t tgt_id);

int ds_pool_bcast_create(crt_context_t ctx, struct ds_pool *pool,
enum daos_module_id module, crt_opcode_t opcode,
Expand Down
2 changes: 1 addition & 1 deletion src/pool/srv_pool.c
Original file line number Diff line number Diff line change
Expand Up @@ -2755,7 +2755,7 @@ ds_pool_create_handler(crt_rpc_t *rpc)

rc = pool_prop_default_copy(prop_dup, prop);
if (rc) {
DL_ERROR(rc, "daos_prop_default_copy failed.\n");
DL_ERROR(rc, "daos_prop_default_copy() failed");
D_GOTO(out_tx, rc);
}

Expand Down
Loading

0 comments on commit 704ab22

Please sign in to comment.