Skip to content

Commit

Permalink
DAOS-13904 pool: don't assert ENOMEM for daos_acl_validate() (#12612)
Browse files Browse the repository at this point in the history
daos_acl_validate() might fail because of out of memory
(e.g.fault injection), don't assert them in the pool
and container IV for this case.

Signed-off-by: Wang Shilong <shilong.wang@intel.com>
  • Loading branch information
wangshilong authored Jul 17, 2023
1 parent 6be7d3a commit ff52861
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/container/container_iv.c
Original file line number Diff line number Diff line change
Expand Up @@ -1275,7 +1275,9 @@ cont_iv_prop_g2l(struct cont_iv_prop *iv_prop, daos_prop_t **prop_out)
prop_entry = &prop->dpp_entries[i++];
acl = &iv_prop->cip_acl;
if (acl->dal_ver != 0) {
D_ASSERT(daos_acl_validate(acl) == 0);
rc = daos_acl_validate(acl);
if (rc != -DER_SUCCESS)
D_GOTO(out, rc);
prop_entry->dpe_val_ptr = daos_acl_dup(acl);
if (prop_entry->dpe_val_ptr == NULL)
D_GOTO(out, rc = -DER_NOMEM);
Expand Down
4 changes: 3 additions & 1 deletion src/pool/srv_iv.c
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,9 @@ pool_iv_prop_g2l(struct pool_iv_prop *iv_prop, daos_prop_t *prop)
roundup(iv_prop->pip_acl_offset, 8));
acl = iv_prop->pip_acl;
if (acl->dal_len > 0) {
D_ASSERT(daos_acl_validate(acl) == 0);
rc = daos_acl_validate(acl);
if (rc != -DER_SUCCESS)
D_GOTO(out, rc);
prop_entry->dpe_val_ptr = daos_acl_dup(acl);
if (prop_entry->dpe_val_ptr == NULL)
D_GOTO(out, rc = -DER_NOMEM);
Expand Down

0 comments on commit ff52861

Please sign in to comment.