From 0907030a495579cb89d9639bdbba5621ab4b4833 Mon Sep 17 00:00:00 2001 From: Mohamad Chaarawi Date: Fri, 13 Dec 2013 10:38:14 -0500 Subject: [svn-r24539] work around iod problem with aborting a kv_set. --- src/H5VLiod.c | 4 ++-- src/H5VLiod_attr.c | 4 ++-- src/H5VLiod_group.c | 1 - src/H5VLiod_link.c | 25 +++++++++++++++++++++---- src/H5VLiod_util.c | 2 +- 5 files changed, 26 insertions(+), 10 deletions(-) diff --git a/src/H5VLiod.c b/src/H5VLiod.c index dc3b8e6..496c54d 100644 --- a/src/H5VLiod.c +++ b/src/H5VLiod.c @@ -6889,9 +6889,9 @@ H5VL_iod_object_get(void *_obj, H5VL_loc_params_t loc_params, H5VL_object_get_t /* Otherwise Go to the server */ if(H5VL_OBJECT_BY_SELF == loc_params.type) - loc_name = strdup("."); + loc_name = HDstrdup("."); else if(H5VL_OBJECT_BY_NAME == loc_params.type) - loc_name = strdup(loc_params.loc_data.loc_by_name.name); + loc_name = HDstrdup(loc_params.loc_data.loc_by_name.name); /* set the input structure for the HG encode routine */ input.coh = obj->file->remote_file.coh; diff --git a/src/H5VLiod_attr.c b/src/H5VLiod_attr.c index b59affb..b855409 100644 --- a/src/H5VLiod_attr.c +++ b/src/H5VLiod_attr.c @@ -753,7 +753,7 @@ H5VL_iod_server_attr_exists_cb(AXE_engine_t UNUSED axe_engine, FUNC_ENTER_NOAPI_NOINIT #if H5VL_IOD_DEBUG - fprintf(stderr, "Start attribute Exists %s\n", attr_name); + fprintf(stderr, "Start attribute Exists %s/%s on CV %d\n", loc_name, attr_name, (int)rtid); #endif /* Open the object where the attribute needs to be checked. */ @@ -807,7 +807,7 @@ H5VL_iod_server_attr_exists_cb(AXE_engine_t UNUSED axe_engine, done: #if H5VL_IOD_DEBUG - fprintf(stderr, "Done with attr exists, sending response to client\n"); + fprintf(stderr, "Done with attr exists, sending %d to client\n", ret); #endif HG_Handler_start_output(op_data->hg_handle, &ret); diff --git a/src/H5VLiod_group.c b/src/H5VLiod_group.c index 392d963..721363e 100644 --- a/src/H5VLiod_group.c +++ b/src/H5VLiod_group.c @@ -91,7 +91,6 @@ H5VL_iod_server_group_create_cb(AXE_engine_t UNUSED axe_engine, fprintf(stderr, "%d (%s).\n", ret, strerror(-ret)); HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't open Group for read"); } - if((ret = iod_obj_open_write(coh, grp_id, wtid, NULL, &grp_oh.wr_oh, NULL)) < 0) { fprintf(stderr, "%d (%s).\n", ret, strerror(-ret)); HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't open Group for write"); diff --git a/src/H5VLiod_link.c b/src/H5VLiod_link.c index 4ffe3f6..0c51982 100644 --- a/src/H5VLiod_link.c +++ b/src/H5VLiod_link.c @@ -410,10 +410,10 @@ H5VL_iod_server_link_exists_cb(AXE_engine_t UNUSED axe_engine, iod_size_t val_size = 0; herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_NOAPI_NOINIT #if H5VL_IOD_DEBUG - fprintf(stderr, "Start link Exists\n"); + fprintf(stderr, "Start link Exists for %s on CV %d\n", loc_name, (int)rtid); #endif /* the traversal will retrieve the location where the link needs @@ -430,7 +430,24 @@ H5VL_iod_server_link_exists_cb(AXE_engine_t UNUSED axe_engine, ret = FALSE; } /* end if */ else { - ret = TRUE; + H5VL_iod_link_t iod_link; + + if(H5VL_iod_get_metadata(cur_oh.rd_oh, rtid, H5VL_IOD_LINK, + last_comp, NULL, NULL, &iod_link) < 0) { + ret = FALSE; + } + else { + iod_handle_t rd_oh; + + if (iod_obj_open_read(coh, iod_link.u.iod_id, rtid, NULL, &rd_oh, NULL) < 0) { + ret = FALSE; + } + else { + if(iod_obj_close(rd_oh, NULL, NULL) < 0) + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't close current object handle"); + ret = TRUE; + } + } } done: @@ -445,7 +462,7 @@ done: } #if H5VL_IOD_DEBUG - fprintf(stderr, "Done with link exists, sending response to client\n"); + fprintf(stderr, "Done with link exists, sending %d to client\n", ret); #endif HG_Handler_start_output(op_data->hg_handle, &ret); diff --git a/src/H5VLiod_util.c b/src/H5VLiod_util.c index a02d83c..ccbca29 100644 --- a/src/H5VLiod_util.c +++ b/src/H5VLiod_util.c @@ -74,7 +74,7 @@ H5VL_iod_server_traverse(iod_handle_t coh, iod_obj_id_t loc_id, iod_handles_t lo /* open the current group */ if(cur_oh.rd_oh.cookie == IOD_OH_UNDEFINED) { - if (iod_obj_open_read(coh, loc_id, wtid, NULL /*hints*/, &cur_oh.rd_oh, NULL) < 0) + if (iod_obj_open_read(coh, loc_id, wtid, NULL, &cur_oh.rd_oh, NULL) < 0) HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't open current group"); } -- cgit v0.12