diff options
-rw-r--r-- | release_docs/RELEASE.txt | 9 | ||||
-rw-r--r-- | src/H5F.c | 7 | ||||
-rw-r--r-- | src/H5FDfamily.c | 31 | ||||
-rw-r--r-- | tools/misc/h5repart.c | 32 |
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 @@ -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; |