summaryrefslogtreecommitdiffstats
path: root/src/H5VLdaosm.c
diff options
context:
space:
mode:
authorNeil Fortner <nfortne2@hdfgroup.org>2016-12-07 21:56:51 (GMT)
committerNeil Fortner <nfortne2@hdfgroup.org>2016-12-07 21:56:51 (GMT)
commit5eb7d11b53c783b104650420cfa2ba4ea1db6144 (patch)
tree3afe48c89e59ff3277535fa03e067366da81c70f /src/H5VLdaosm.c
parent340b4658a42567dfd5595721de349e7d5a55ed3a (diff)
downloadhdf5-5eb7d11b53c783b104650420cfa2ba4ea1db6144.zip
hdf5-5eb7d11b53c783b104650420cfa2ba4ea1db6144.tar.gz
hdf5-5eb7d11b53c783b104650420cfa2ba4ea1db6144.tar.bz2
Fix memory leak in H5VL_daosm_dataset_write, bug in
H5VL_daosm_file_open, bug in h5dsm_dset_wpartial, and add separate transactions in h5dsm_dset_wpartial.
Diffstat (limited to 'src/H5VLdaosm.c')
-rw-r--r--src/H5VLdaosm.c27
1 files changed, 17 insertions, 10 deletions
diff --git a/src/H5VLdaosm.c b/src/H5VLdaosm.c
index eb2679c..8ee4ab7 100644
--- a/src/H5VLdaosm.c
+++ b/src/H5VLdaosm.c
@@ -898,6 +898,12 @@ H5VL_daosm_file_open(const char *name, unsigned flags, hid_t fapl_id,
/* Read from the HCE */
epoch--;
+ /* Generate roor group ID */
+ root_grp_oid.lo = 1; //DSMINC
+ root_grp_oid.mid = 0; //DSMINC
+ root_grp_oid.hi = 0; //DSMINC
+ daos_obj_id_generate(&root_grp_oid, DAOS_OC_TINY_RW); //DSMINC
+
/* Bcast global handles if there are other processes */
if(file->num_procs > 1) {
/* Calculate sizes of global pool and container handles */
@@ -915,9 +921,9 @@ H5VL_daosm_file_open(const char *name, unsigned flags, hid_t fapl_id,
bcast_buf_64[1] = (uint64_t)glob.iov_buf_len;
/* Add root group oid to bcast_buf_64 */
- bcast_buf_64[2] = file->root_grp->oid.lo;
- bcast_buf_64[3] = file->root_grp->oid.mid;
- bcast_buf_64[4] = file->root_grp->oid.hi;
+ bcast_buf_64[2] = root_grp_oid.lo;
+ bcast_buf_64[3] = root_grp_oid.mid;
+ bcast_buf_64[4] = root_grp_oid.hi;
/* Add epoch to bcast_buf_64 */
HDassert(sizeof(bcast_buf_64[5]) == sizeof(epoch));
@@ -963,9 +969,9 @@ H5VL_daosm_file_open(const char *name, unsigned flags, hid_t fapl_id,
} /* end if */
/* Retrieve root group oid from bcast_buf_64 */
- file->root_grp->oid.lo = bcast_buf_64[2];
- file->root_grp->oid.mid = bcast_buf_64[3];
- file->root_grp->oid.hi = bcast_buf_64[4];
+ root_grp_oid.lo = bcast_buf_64[2];
+ root_grp_oid.mid = bcast_buf_64[3];
+ root_grp_oid.hi = bcast_buf_64[4];
/* Retrieve epoch from bcast_buf_64 */
HDassert(sizeof(bcast_buf_64[5]) == sizeof(epoch));
@@ -1003,10 +1009,6 @@ H5VL_daosm_file_open(const char *name, unsigned flags, hid_t fapl_id,
file->max_oid_dirty = FALSE; //DSMINC
/* Open root group */
- root_grp_oid.lo = 1; //DSMINC
- root_grp_oid.mid = 0; //DSMINC
- root_grp_oid.hi = 0; //DSMINC
- daos_obj_id_generate(&root_grp_oid, DAOS_OC_TINY_RW); //DSMINC
if(NULL == (file->root_grp = (H5VL_daosm_group_t *)H5VL_daosm_group_open_helper(file, root_grp_oid, H5P_GROUP_ACCESS_DEFAULT, dxpl_id, req, epoch)))
HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, "can't open root group")
@@ -2376,6 +2378,11 @@ H5VL_daosm_dataset_write(void *_dset, hid_t H5_ATTR_UNUSED mem_type_id, hid_t H5
HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "can't write data to dataset: %d", ret)
done:
+ if(recxs != &recx)
+ H5MM_free(recxs);
+ if(sg_iovs != &sg_iov)
+ H5MM_free(sg_iovs);
+
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5VL_daosm_dataset_write() */