diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/H5F.c | 7 | ||||
-rw-r--r-- | src/H5FDfamily.c | 31 |
2 files changed, 32 insertions, 6 deletions
@@ -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 * |