From 02ca8127867a11ed57cfb8da11ab9cea6dd4b516 Mon Sep 17 00:00:00 2001 From: Raymond Lu Date: Fri, 20 May 2005 16:50:20 -0500 Subject: [svn-r10778] Purpose: Bug fix Description: 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 second step of fixing this bug. 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. The third step will be changing h5repart to let it change family member size in the superblock if user uses it to change member file size. Platforms tested: h5committest and fuss. --- src/H5F.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/H5F.c b/src/H5F.c index 227bf9c..6cb937d 100644 --- a/src/H5F.c +++ b/src/H5F.c @@ -2555,11 +2555,13 @@ 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.*/ + /* Check if driver matches driver information 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(!HDstrncmp(driver_name, "NCSAmult", 8) && HDstrcmp(lf->cls->name, "multi")) + HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "multi 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 */ -- cgit v0.12