summaryrefslogtreecommitdiffstats
path: root/src/H5F.c
diff options
context:
space:
mode:
authorRaymond Lu <songyulu@hdfgroup.org>2005-05-20 18:24:26 (GMT)
committerRaymond Lu <songyulu@hdfgroup.org>2005-05-20 18:24:26 (GMT)
commit9cf358dbb8140fb538c3ef0d52e77ef9e4ca1833 (patch)
tree96ff1aca2a9b7f1667692a680051212943855862 /src/H5F.c
parentba95b9133c12258fcd795f2b3e3597d9273b2f89 (diff)
downloadhdf5-9cf358dbb8140fb538c3ef0d52e77ef9e4ca1833.zip
hdf5-9cf358dbb8140fb538c3ef0d52e77ef9e4ca1833.tar.gz
hdf5-9cf358dbb8140fb538c3ef0d52e77ef9e4ca1833.tar.bz2
[svn-r10776] Purpose: Bug fix
Description: See details from Bug #213. Family member file size wasn't saved anywhere in file. When family file is opened, the first member size determine the member size. Solution: This is the first step of fixing this bug. Member size and name template(unused at this stage) are saved in file superblock. When file is reopened, the size passed in through H5Pset_fapl_family is checked against the size saved in superblock. A different size will trigger a failure with an error message indicating the right size. Wrong driver to open family file will cause a failure, too. The second step will change multi driver that wrong driver will cause a failure. Platforms tested: fuss and h5committest
Diffstat (limited to 'src/H5F.c')
-rw-r--r--src/H5F.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/H5F.c b/src/H5F.c
index 442baac..227bf9c 100644
--- a/src/H5F.c
+++ b/src/H5F.c
@@ -2070,6 +2070,7 @@ H5Fcreate(const char *filename, unsigned flags, hid_t fcpl_id, hid_t fapl_id)
H5F_t *new_file = NULL; /*file struct for new file */
hid_t ret_value; /*return value */
+ hid_t estack_id;
FUNC_ENTER_API(H5Fcreate, FAIL)
H5TRACE4("i","sIuii",filename,flags,fcpl_id,fapl_id);
@@ -2554,9 +2555,15 @@ H5F_read_superblock(H5F_t *f, hid_t dxpl_id, H5G_entry_t *root_ent, haddr_t addr
HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "unable to read file driver information")
} /* end if */
+ /* Check if driver matches family driver saved. Unfortunately, we can't push this function to
+ * each specific driver because we're checking if the driver is correct.*/
+ if(!HDstrncmp(driver_name, "NCSAfami", 8) && HDstrcmp(lf->cls->name, "family"))
+ HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "family driver should be used")
+
if (H5FD_sb_decode(lf, driver_name, p) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "unable to decode driver information")
-
+ p += driver_size; /* advance past driver information section */
+
/* Compute driver info block checksum */
assert(sizeof(chksum) == sizeof(shared->drvr_chksum));
for (q = (uint8_t *)&chksum, chksum = 0, i = 0; i < (driver_size + 16); ++i)