summaryrefslogtreecommitdiffstats
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
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
-rw-r--r--release_docs/RELEASE.txt9
-rw-r--r--src/H5F.c7
-rw-r--r--src/H5FDfamily.c31
-rw-r--r--tools/misc/h5repart.c32
4 files changed, 71 insertions, 8 deletions
diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt
index 85dac4f..aae113a 100644
--- a/release_docs/RELEASE.txt
+++ b/release_docs/RELEASE.txt
@@ -286,8 +286,15 @@ Bug Fixes since HDF5-1.6.0 release
Library
-------
+ - For family driver, the library didn't save member size in file.
+ When file is reopened, the size of 1st member file determine the
+ member size. Now member size is saved in file and is used to
+ define member file size. Wrong file access property of member size
+ will result in a failure. Using any other driver except family
+ will cause library to return error. So is multi driver. SLU -
+ 2005/05/24
- Fixed error in opening object in group that was opened in mounted
- file which has been unmounted. QAK - 2005/03/17
+ file which has been unmounted. QAK - 2005/03/17
- Fixed a racing condition in MPIPOSIX virtual file drive close
function. Now all processes must completed the close before any
of them is returned. This prevents some "faster" processes start
diff --git a/src/H5F.c b/src/H5F.c
index 6cb937d..485805f 100644
--- a/src/H5F.c
+++ b/src/H5F.c
@@ -2310,7 +2310,12 @@ done:
* Sept 12, 2003
*
* Modifications:
- *
+ * Raymond Lu
+ * May 24, 2005
+ * Started to check if driver(only family and multi drivers)
+ * matches driver information saved in the superblock. Wrong
+ * driver will result in a failure.
+ *
*-------------------------------------------------------------------------
*/
static herr_t
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 *
diff --git a/tools/misc/h5repart.c b/tools/misc/h5repart.c
index 0518a76..0bd2dd8 100644
--- a/tools/misc/h5repart.c
+++ b/tools/misc/h5repart.c
@@ -223,7 +223,9 @@ main (int argc, char *argv[])
off_t src_act_size; /*source actual member size */
off_t dst_size=1 GB; /*destination logical memb size */
#endif
-
+ hid_t fapl;
+ hid_t file;
+
/*
* Get the program name from argv[0]. Use only the last component.
*/
@@ -441,7 +443,35 @@ main (int argc, char *argv[])
}
}
close (dst);
+
+ /* modify family size saved in superblock. Member size 1 signals library to
+ * save the new size(actual member file size) in superblock. It's for this
+ * tool only. */
+ if ((fapl=H5Pcreate(H5P_FILE_ACCESS))<0) {
+ perror ("H5Pcreate");
+ exit (1);
+ }
+ if(H5Pset_fapl_family(fapl, 1, H5P_DEFAULT)<0) {
+ perror ("H5Pset_fapl_family");
+ exit (1);
+ }
+
+ if((file=H5Fopen(dst_gen_name, H5F_ACC_RDWR, fapl))<0) {
+ perror ("H5Fopen");
+ exit (1);
+ }
+
+ if(H5Fclose(file)<0) {
+ perror ("H5Fclose");
+ exit (1);
+ }
+
+ if(H5Pclose(fapl)<0) {
+ perror ("H5Pclose");
+ exit (1);
+ }
+
/* Free resources and return */
free (buf);
return 0;