Skip to content

Commit

Permalink
DAOS-15068 engine: check IV refresh result
Browse files Browse the repository at this point in the history
Check IV refresh result during cart IV fetch, to
avoid further failure if the fetched value is corrupted.

Required-githooks: true

Signed-off-by: Di Wang <[email protected]>
  • Loading branch information
Di Wang committed Jan 23, 2024
1 parent 7d05adb commit 3d36451
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/cart/crt_iv.c
Original file line number Diff line number Diff line change
Expand Up @@ -1086,8 +1086,8 @@ handle_ivfetch_response(const struct crt_cb_info *cb_info)
}

/* In case of a failure, call on_refresh with NULL iv_value */
iv_ops->ivo_on_refresh(ivns, &input->ifi_key, 0, /* TODO: iv_ver */
iv_value, false, rc, iv_info->ifc_user_priv);
rc = iv_ops->ivo_on_refresh(ivns, &input->ifi_key, 0, /* TODO: iv_ver */
iv_value, false, rc, iv_info->ifc_user_priv);

if (iv_info->ifc_bulk_hdl)
crt_bulk_free(iv_info->ifc_bulk_hdl);
Expand Down
3 changes: 3 additions & 0 deletions src/engine/server_iv.c
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,9 @@ ivc_on_refresh(crt_iv_namespace_t ivns, crt_iv_key_t *iv_key,
crt_iv_ver_t iv_ver, d_sg_list_t *iv_value,
bool invalidate, int refresh_rc, void *priv)
{
if (refresh_rc != 0)
return refresh_rc;

return iv_on_update_internal(ivns, iv_key, iv_ver, iv_value, invalidate,
true, refresh_rc, priv);
}
Expand Down

0 comments on commit 3d36451

Please sign in to comment.