diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2009-03-26 18:31:00 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2009-03-26 18:31:00 (GMT) |
commit | 505b31ee08bfd3efc62df84e00602a9fd6c46a4f (patch) | |
tree | 77c1e8cd2a59bfb655f789fd6ddac4e74b4fe5c9 /src/H5Fsuper.c | |
parent | 5f2e591745df8a05950c07e4c86de00d6678828e (diff) | |
download | hdf5-505b31ee08bfd3efc62df84e00602a9fd6c46a4f.zip hdf5-505b31ee08bfd3efc62df84e00602a9fd6c46a4f.tar.gz hdf5-505b31ee08bfd3efc62df84e00602a9fd6c46a4f.tar.bz2 |
[svn-r16619] Description:
Bring r16606:16618 from trunk to the revise_chunks branch.
Tested on:
FreeBSD/32 6.3 (duty)
h5committest not necessary on this branch
Diffstat (limited to 'src/H5Fsuper.c')
-rw-r--r-- | src/H5Fsuper.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/H5Fsuper.c b/src/H5Fsuper.c index 70e0954..8040554 100644 --- a/src/H5Fsuper.c +++ b/src/H5Fsuper.c @@ -560,7 +560,8 @@ H5F_super_read(H5F_t *f, hid_t dxpl_id, H5G_loc_t *root_loc) * Tell the file driver how much address space has already been * allocated so that it knows how to allocate additional memory. */ - if(H5FD_set_eoa(lf, H5FD_MEM_SUPER, stored_eoa) < 0) + /* (Account for the stored EOA being absolute offset -NAF) */ + if(H5FD_set_eoa(lf, H5FD_MEM_SUPER, stored_eoa - H5F_BASE_ADDR(f)) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "unable to set end-of-address marker for file") /* Read the file's superblock extension, if there is one. */ @@ -934,7 +935,15 @@ H5F_super_write(H5F_t *f, hid_t dxpl_id) /* Encode the driver information block. */ H5_ASSIGN_OVERFLOW(driver_size, H5FD_sb_size(f->shared->lf), hsize_t, size_t); - if(driver_size > 0) { + + /* Checking whether driver block address is defined here is to handle backward + * compatibility. If the file was created with v1.6 library or earlier and no + * driver info block was written in the superblock, we don't write it either even + * though there's some driver info. Otherwise, the driver block extended will + * overwrite the (meta)data right after the superblock. This situation happens to + * the family driver particularly. SLU - 2009/3/24 + */ + if(driver_size > 0 && H5F_addr_defined(f->shared->driver_addr)) { char driver_name[9]; /* Name of driver, for driver info block */ uint8_t *dbuf = p; /* Pointer to beginning of driver info */ |