Skip to content

Commit

Permalink
Prevent H5Pset* routines from modifying default plists (#5172)
Browse files Browse the repository at this point in the history
* Prevent H5Pset_vol from changing default VOL
* Prevent public routines from modifying default plists
* Allow default backing FAPL for onion VFD
* Require FAPL in H5Pset_vol()
* Merge into existing H5P tests
  • Loading branch information
mattjala authored Dec 17, 2024
1 parent f0cffc9 commit 914640e
Show file tree
Hide file tree
Showing 41 changed files with 362 additions and 236 deletions.
10 changes: 10 additions & 0 deletions release_docs/RELEASE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,17 @@ New Features
There is no API compatibility wrapper for this change.

Fixes GitHub issue #3506

- H5Pset* routines now fail when used on default property lists

Modifying default property lists was never fully supported and could produce
inconsistent and unexpected behavior.

- H5Pset_vol() now fails when used on a non-file-access property list

Similar to the above. Setting the connector on a non-FAPL had no effect on
library behavior, and the connector ID and information could not be read back
from that plist later.

Parallel Library:
-----------------
Expand Down
8 changes: 4 additions & 4 deletions src/H5FDcore.c
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ H5Pset_core_write_tracking(hid_t plist_id, hbool_t is_enabled, size_t page_size)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "page_size cannot be zero");

/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS)))
if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS, false)))
HGOTO_ERROR(H5E_PLIST, H5E_BADID, FAIL, "can't find object for ID");
if (H5FD_CORE != H5P_peek_driver(plist))
HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "incorrect VFL driver");
Expand Down Expand Up @@ -550,7 +550,7 @@ H5Pget_core_write_tracking(hid_t plist_id, hbool_t *is_enabled /*out*/, size_t *
FUNC_ENTER_API(FAIL)

/* Get the plist structure */
if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS)))
if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS, true)))
HGOTO_ERROR(H5E_PLIST, H5E_BADID, FAIL, "can't find object for ID");
if (H5FD_CORE != H5P_peek_driver(plist))
HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "incorrect VFL driver");
Expand Down Expand Up @@ -588,7 +588,7 @@ H5Pset_fapl_core(hid_t fapl_id, size_t increment, hbool_t backing_store)
FUNC_ENTER_API(FAIL)

/* Check argument */
if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, false)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list");

/* Set VFD info values */
Expand Down Expand Up @@ -624,7 +624,7 @@ H5Pget_fapl_core(hid_t fapl_id, size_t *increment /*out*/, hbool_t *backing_stor

FUNC_ENTER_API(FAIL)

if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, true)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list");
if (H5FD_CORE != H5P_peek_driver(plist))
HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "incorrect VFL driver");
Expand Down
6 changes: 3 additions & 3 deletions src/H5FDdirect.c
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ H5Pset_fapl_direct(hid_t fapl_id, size_t boundary, size_t block_size, size_t cbu

FUNC_ENTER_API(FAIL)

if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, false)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list");

if (H5FD__direct_populate_config(boundary, block_size, cbuf_size, &fa) < 0)
Expand Down Expand Up @@ -256,7 +256,7 @@ H5Pget_fapl_direct(hid_t fapl_id, size_t *boundary /*out*/, size_t *block_size /

FUNC_ENTER_API(FAIL)

if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, true)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access list");
if (H5FD_DIRECT != H5P_peek_driver(plist))
HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "incorrect VFL driver");
Expand Down Expand Up @@ -443,7 +443,7 @@ H5FD__direct_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxad
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "unable to allocate file struct");

/* Get the driver specific information */
if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, true)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a file access property list");
if (NULL == (fa = (const H5FD_direct_fapl_t *)H5P_peek_driver_info(plist))) {
if (H5FD__direct_populate_config(0, 0, 0, &default_fa) < 0)
Expand Down
4 changes: 2 additions & 2 deletions src/H5FDfamily.c
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ H5Pget_fapl_family(hid_t fapl_id, hsize_t *msize /*out*/, hid_t *memb_fapl_id /*

FUNC_ENTER_API(FAIL)

if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, true)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access list");
if (H5FD_FAMILY != H5P_peek_driver(plist))
HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "incorrect VFL driver");
Expand Down Expand Up @@ -1118,7 +1118,7 @@ H5FD__family_get_handle(H5FD_t *_file, hid_t fapl, void **file_handle)
FUNC_ENTER_PACKAGE

/* Get the plist structure and family offset */
if (NULL == (plist = H5P_object_verify(fapl, H5P_FILE_ACCESS)))
if (NULL == (plist = H5P_object_verify(fapl, H5P_FILE_ACCESS, true)))
HGOTO_ERROR(H5E_VFL, H5E_BADID, FAIL, "can't find object for ID");
if (H5P_get(plist, H5F_ACS_FAMILY_OFFSET_NAME, &offset) < 0)
HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "can't get offset for family driver");
Expand Down
4 changes: 2 additions & 2 deletions src/H5FDhdfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ H5Pset_fapl_hdfs(hid_t fapl_id, H5FD_hdfs_fapl_t *fa)
fprintf(stdout, "called %s.\n", __func__);
#endif

plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS);
plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, false);
if (plist == NULL)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list");
if (FAIL == H5FD__hdfs_validate_config(fa))
Expand Down Expand Up @@ -621,7 +621,7 @@ H5Pget_fapl_hdfs(hid_t fapl_id, H5FD_hdfs_fapl_t *fa_dst /*out*/)

if (fa_dst == NULL)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "fa_dst ptr is NULL");
plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS);
plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, true);
if (plist == NULL)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access list");

Expand Down
4 changes: 2 additions & 2 deletions src/H5FDlog.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ H5Pset_fapl_log(hid_t fapl_id, const char *logfile, unsigned long long flags, si
memset(&fa, 0, sizeof(H5FD_log_fapl_t));

/* Check arguments */
if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, false)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list");

/* Duplicate the log file string
Expand Down Expand Up @@ -446,7 +446,7 @@ H5FD__log_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr)
o_flags |= O_EXCL;

/* Get the driver specific information */
if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, true)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a file access property list");
if (NULL == (fa = (const H5FD_log_fapl_t *)H5P_peek_driver_info(plist))) {
/* Use default driver configuration*/
Expand Down
4 changes: 2 additions & 2 deletions src/H5FDmirror.c
Original file line number Diff line number Diff line change
Expand Up @@ -1247,7 +1247,7 @@ H5Pget_fapl_mirror(hid_t fapl_id, H5FD_mirror_fapl_t *fa_dst /*out*/)
if (NULL == fa_dst)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "fa_dst is NULL");

plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS);
plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, true);
if (NULL == plist)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list");
if (H5P_peek_driver(plist) != H5FD_MIRROR)
Expand Down Expand Up @@ -1284,7 +1284,7 @@ H5Pset_fapl_mirror(hid_t fapl_id, H5FD_mirror_fapl_t *fa)

LOG_OP_CALL(__func__);

plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS);
plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, false);
if (NULL == plist)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list");
if (NULL == fa)
Expand Down
20 changes: 10 additions & 10 deletions src/H5FDmpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ H5Pset_fapl_mpio(hid_t fapl_id, MPI_Comm comm, MPI_Info info)
/* Check arguments */
if (fapl_id == H5P_DEFAULT)
HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "can't set values in default property list");
if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, false)))
HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a file access list");
if (MPI_COMM_NULL == comm)
HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "MPI_COMM_NULL is not a valid communicator");
Expand Down Expand Up @@ -485,7 +485,7 @@ H5Pget_fapl_mpio(hid_t fapl_id, MPI_Comm *comm /*out*/, MPI_Info *info /*out*/)
*info = MPI_INFO_NULL;

/* Check arguments */
if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, true)))
HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a file access list");
if (H5FD_MPIO != H5P_peek_driver(plist))
HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "VFL driver is not MPI-I/O");
Expand Down Expand Up @@ -549,7 +549,7 @@ H5Pset_dxpl_mpio(hid_t dxpl_id, H5FD_mpio_xfer_t xfer_mode)
/* Check arguments */
if (dxpl_id == H5P_DEFAULT)
HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "can't set values in default property list");
if (NULL == (plist = H5P_object_verify(dxpl_id, H5P_DATASET_XFER)))
if (NULL == (plist = H5P_object_verify(dxpl_id, H5P_DATASET_XFER, false)))
HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a dxpl");
if (H5FD_MPIO_INDEPENDENT != xfer_mode && H5FD_MPIO_COLLECTIVE != xfer_mode)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "incorrect xfer_mode");
Expand Down Expand Up @@ -589,7 +589,7 @@ H5Pget_dxpl_mpio(hid_t dxpl_id, H5FD_mpio_xfer_t *xfer_mode /*out*/)
FUNC_ENTER_API(FAIL)

/* Check arguments */
if (NULL == (plist = H5P_object_verify(dxpl_id, H5P_DATASET_XFER)))
if (NULL == (plist = H5P_object_verify(dxpl_id, H5P_DATASET_XFER, true)))
HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a dxpl");

/* Initialize driver, if it's not yet */
Expand Down Expand Up @@ -633,7 +633,7 @@ H5Pset_dxpl_mpio_collective_opt(hid_t dxpl_id, H5FD_mpio_collective_opt_t opt_mo
/* Check arguments */
if (dxpl_id == H5P_DEFAULT)
HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "can't set values in default property list");
if (NULL == (plist = H5P_object_verify(dxpl_id, H5P_DATASET_XFER)))
if (NULL == (plist = H5P_object_verify(dxpl_id, H5P_DATASET_XFER, false)))
HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a dxpl");

/* Initialize driver, if it's not yet */
Expand Down Expand Up @@ -676,7 +676,7 @@ H5Pset_dxpl_mpio_chunk_opt(hid_t dxpl_id, H5FD_mpio_chunk_opt_t opt_mode)
/* Check arguments */
if (dxpl_id == H5P_DEFAULT)
HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "can't set values in default property list");
if (NULL == (plist = H5P_object_verify(dxpl_id, H5P_DATASET_XFER)))
if (NULL == (plist = H5P_object_verify(dxpl_id, H5P_DATASET_XFER, false)))
HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a dxpl");

/* Initialize driver, if it's not yet */
Expand Down Expand Up @@ -717,7 +717,7 @@ H5Pset_dxpl_mpio_chunk_opt_num(hid_t dxpl_id, unsigned num_chunk_per_proc)
/* Check arguments */
if (dxpl_id == H5P_DEFAULT)
HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "can't set values in default property list");
if (NULL == (plist = H5P_object_verify(dxpl_id, H5P_DATASET_XFER)))
if (NULL == (plist = H5P_object_verify(dxpl_id, H5P_DATASET_XFER, false)))
HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a dxpl");

/* Initialize driver, if it's not yet */
Expand Down Expand Up @@ -761,7 +761,7 @@ H5Pset_dxpl_mpio_chunk_opt_ratio(hid_t dxpl_id, unsigned percent_num_proc_per_ch
/* Check arguments */
if (dxpl_id == H5P_DEFAULT)
HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "can't set values in default property list");
if (NULL == (plist = H5P_object_verify(dxpl_id, H5P_DATASET_XFER)))
if (NULL == (plist = H5P_object_verify(dxpl_id, H5P_DATASET_XFER, false)))
HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a dxpl");

/* Initialize driver, if it's not yet */
Expand Down Expand Up @@ -904,7 +904,7 @@ H5FD__mpio_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t H5_ATTR
HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, NULL, "can't initialize driver");

/* Get a pointer to the fapl */
if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, true)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a file access property list");

if (H5FD_mpi_self_initialized_s) {
Expand Down Expand Up @@ -3822,7 +3822,7 @@ H5FD__mpio_delete(const char *filename, hid_t fapl_id)
if (H5FD__mpio_init() < 0)
HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "can't initialize driver");

if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, true)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list");
assert(H5FD_MPIO == H5P_peek_driver(plist));

Expand Down
10 changes: 5 additions & 5 deletions src/H5FDonion.c
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ H5Pget_fapl_onion(hid_t fapl_id, H5FD_onion_fapl_info_t *fa_out)
if (NULL == fa_out)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL info-out pointer");

if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, true)))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Not a valid FAPL ID");

if (H5FD_ONION != H5P_peek_driver(plist))
Expand Down Expand Up @@ -316,7 +316,7 @@ H5Pset_fapl_onion(hid_t fapl_id, const H5FD_onion_fapl_info_t *fa)

FUNC_ENTER_API(FAIL)

if (NULL == (fapl = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
if (NULL == (fapl = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, false)))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Not a valid FAPL ID");
if (NULL == fa)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL info pointer");
Expand All @@ -328,11 +328,11 @@ H5Pset_fapl_onion(hid_t fapl_id, const H5FD_onion_fapl_info_t *fa)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid info page size");

if (H5P_DEFAULT == fa->backing_fapl_id) {
if (NULL == (backing_fapl = H5P_object_verify(H5P_FILE_ACCESS_DEFAULT, H5P_FILE_ACCESS)))
if (NULL == (backing_fapl = H5P_object_verify(H5P_FILE_ACCESS_DEFAULT, H5P_FILE_ACCESS, true)))
HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "invalid backing fapl id");
}
else {
if (NULL == (backing_fapl = H5P_object_verify(fa->backing_fapl_id, H5P_FILE_ACCESS)))
if (NULL == (backing_fapl = H5P_object_verify(fa->backing_fapl_id, H5P_FILE_ACCESS, true)))
HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "invalid backing fapl id");
}

Expand Down Expand Up @@ -1635,7 +1635,7 @@ H5FDonion_get_revision_count(const char *filename, hid_t fapl_id, uint64_t *revi
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "revision count can't be null");

/* Make sure using the correct driver */
if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, true)))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a valid FAPL ID");
if (H5FD_ONION != H5P_peek_driver(plist))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a Onion VFL driver");
Expand Down
10 changes: 5 additions & 5 deletions src/H5FDros3.c
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ H5Pset_fapl_ros3(hid_t fapl_id, const H5FD_ros3_fapl_t *fa)

assert(fa != NULL);

plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS);
plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, false);
if (plist == NULL)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list");

Expand Down Expand Up @@ -357,7 +357,7 @@ H5Pget_fapl_ros3(hid_t fapl_id, H5FD_ros3_fapl_t *fa_dst /*out*/)

if (fa_dst == NULL)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "fa_dst is NULL");
if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, true)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access list");
if (H5FD_ROS3 != H5P_peek_driver(plist))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "fapl not set to use the ros3 VFD");
Expand Down Expand Up @@ -489,7 +489,7 @@ H5Pget_fapl_ros3_token(hid_t fapl_id, size_t size, char *token_dst /*out*/)
if (token_dst == NULL)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "token_dst is NULL");

if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, true)))
HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a file access property list");
if (H5FD_ROS3 != H5P_peek_driver(plist))
HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "incorrect VFL driver");
Expand Down Expand Up @@ -641,7 +641,7 @@ H5Pset_fapl_ros3_token(hid_t fapl_id, const char *token)

if (fapl_id == H5P_DEFAULT)
HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "can't set values in default property list");
if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, false)))
HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a file access property list");
if (H5FD_ROS3 != H5P_peek_driver(plist))
HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "incorrect VFL driver");
Expand Down Expand Up @@ -717,7 +717,7 @@ H5FD__ros3_open(const char *url, unsigned flags, hid_t fapl_id, haddr_t maxaddr)
HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, NULL, "bogus maxaddr");
if (flags != H5F_ACC_RDONLY)
HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, NULL, "only Read-Only access allowed");
if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, true)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a file access property list");

/* Initialize driver, if it's not yet */
Expand Down
2 changes: 1 addition & 1 deletion src/H5FDsec2.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ H5Pset_fapl_sec2(hid_t fapl_id)

FUNC_ENTER_API(FAIL)

if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, false)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list");

ret_value = H5P_set_driver(plist, H5FD_SEC2, NULL, NULL);
Expand Down
2 changes: 1 addition & 1 deletion src/H5FDsplitter.c
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ H5Pget_fapl_splitter(hid_t fapl_id, H5FD_splitter_vfd_config_t *config /*out*/)
config->wo_fapl_id = H5I_INVALID_HID;

/* Check and get the splitter fapl */
if (NULL == (plist_ptr = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
if (NULL == (plist_ptr = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, true)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list");
if (H5FD_SPLITTER != H5P_peek_driver(plist_ptr))
HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "incorrect VFL driver");
Expand Down
6 changes: 3 additions & 3 deletions src/H5FDsubfiling/H5FDioc.c
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ H5Pset_fapl_ioc(hid_t fapl_id, H5FD_ioc_config_t *vfd_config)

FUNC_ENTER_API(FAIL)

if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, false)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list");

/* Initialize driver, if it's not yet */
Expand Down Expand Up @@ -369,7 +369,7 @@ H5Pget_fapl_ioc(hid_t fapl_id, H5FD_ioc_config_t *config_out)
/* Check arguments */
if (config_out == NULL)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "config_out is NULL");
if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS)))
if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS, true)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list");

/* Initialize driver, if it's not yet */
Expand Down Expand Up @@ -1249,7 +1249,7 @@ H5FD__ioc_delete(const char *name, hid_t fapl)
if (H5FD__ioc_init() < 0)
HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "can't initialize driver");

if (NULL == (plist = H5P_object_verify(fapl, H5P_FILE_ACCESS)))
if (NULL == (plist = H5P_object_verify(fapl, H5P_FILE_ACCESS, true)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list");
assert(H5FD_IOC == H5P_peek_driver(plist));

Expand Down
Loading

0 comments on commit 914640e

Please sign in to comment.