summaryrefslogtreecommitdiffstats
path: root/src/H5FDfamily.c
diff options
context:
space:
mode:
authorRaymond Lu <songyulu@hdfgroup.org>2005-05-24 21:00:16 (GMT)
committerRaymond Lu <songyulu@hdfgroup.org>2005-05-24 21:00:16 (GMT)
commit38b33b83308d00f6d882bba87069e2b77fd95443 (patch)
tree0f7eb0729558ce54c03b29b3b9c33bdbe4853ce2 /src/H5FDfamily.c
parentf1aa157f580efc4328cf8b194822b7229a738bee (diff)
downloadhdf5-38b33b83308d00f6d882bba87069e2b77fd95443.zip
hdf5-38b33b83308d00f6d882bba87069e2b77fd95443.tar.gz
hdf5-38b33b83308d00f6d882bba87069e2b77fd95443.tar.bz2
[svn-r10795] 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 third step of checkin. h5repart has been modified. If h5repart is used to change the size of family member file, the new size(actual member size) is saved in the superblock. In the second step of checkin, multi driver is checked against the driver name saved in superblock. Wrong driver will result in a failure with an error message indicating multi driver should be used. This change includes split driver because it's a special case for multi driver. In the first step of checkin. Family member size and name template(unused at this stage) are saved in file superblock. When file is reopened,the size passed in thrin 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. Platforms tested: h5committest and fuss Misc. update: RELEASE.txt
Diffstat (limited to 'src/H5FDfamily.c')
-rw-r--r--src/H5FDfamily.c31
1 files changed, 26 insertions, 5 deletions
diff --git a/src/H5FDfamily.c b/src/H5FDfamily.c
index 28824e3..d4397e9 100644
--- a/src/H5FDfamily.c
+++ b/src/H5FDfamily.c
@@ -672,17 +672,30 @@ H5FD_family_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf)
/* Read member file size. Skip name template for now although it's saved. */
UINT64DECODE(p, msize);
-
+
+ /* For h5repart only. Member size 1 is used to signal h5repart is being used to
+ * change member file size. Encode the new size. */
+ if(file->pmem_size == 1) {
+ msize = file->memb_size;
+ UINT64ENCODE(p, msize);
+ HGOTO_DONE(ret_value)
+ }
+
/* Default - use the saved member size */
- if(file->pmem_size == H5F_FAMILY_DEFAULT)
- file->memb_size = msize;
+ if(file->pmem_size == H5F_FAMILY_DEFAULT) {
+ file->pmem_size = msize;
+ }
- /* Check if member size is correct */
- if(file->memb_size != msize) {
+ /* Check if member size from file access property is correct */
+ if(file->pmem_size != msize) {
sprintf(err_msg, "family member size should be %lu", msize);
HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, err_msg)
}
+ /* Update member file size to the size saved in the superblock.
+ * That's the size intended to be. */
+ file->memb_size = msize;
+
done:
FUNC_LEAVE_NOAPI(ret_value)
}
@@ -711,6 +724,14 @@ done:
* If there are at least 2 member files, member size can only be equal
* the 1st member size.
*
+ * Raymond Lu
+ * Tuesday, May 24, 2005
+ * The modification described above has been changed. The major checking
+ * is done in H5F_read_superblock. Member file size is saved in the
+ * superblock now. H5F_read_superblock() reads this saved size and compare
+ * to the size passed in from file access property. Wrong size will
+ * result in a failure.
+ *
*-------------------------------------------------------------------------
*/
static H5FD_t *