summaryrefslogtreecommitdiffstats
path: root/src/H5Fsuper.c
diff options
context:
space:
mode:
authorNeil Fortner <nfortne2@hdfgroup.org>2009-04-08 21:53:31 (GMT)
committerNeil Fortner <nfortne2@hdfgroup.org>2009-04-08 21:53:31 (GMT)
commitc1c58f79a865a1e4bf53949e8819f6612c2cbd93 (patch)
tree156e27bc731b365284991ea0e3cf53a1cdf5c9d6 /src/H5Fsuper.c
parent659f3a77ea0f7548ed09a9624de3fe2a183f451c (diff)
downloadhdf5-c1c58f79a865a1e4bf53949e8819f6612c2cbd93.zip
hdf5-c1c58f79a865a1e4bf53949e8819f6612c2cbd93.tar.gz
hdf5-c1c58f79a865a1e4bf53949e8819f6612c2cbd93.tar.bz2
[svn-r16710] Purpose: Fix bug 1423
Description: Versions of the library between 1.3.0 and 1.6.3 have a bug which prevents them from opening any file that does not have the root group's symbol table information cached in the root group's entry in the superblock. Prior to 1.8 this was not an issue as this information was always cached. However, 1.8.0 stopped writing this information (which is not required by the file format specification), and these older versions can therefore not read files created or last written by versions 1.8.0 to 1.8.2. This fix modifies the library to once again add this information to the superblock (when using the old file format). Tested: jam, linew, smirom (h5committest)
Diffstat (limited to 'src/H5Fsuper.c')
-rw-r--r--src/H5Fsuper.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/H5Fsuper.c b/src/H5Fsuper.c
index 8040554..32541ae 100644
--- a/src/H5Fsuper.c
+++ b/src/H5Fsuper.c
@@ -32,6 +32,7 @@
#include "H5FDprivate.h" /* File drivers */
#include "H5Iprivate.h" /* IDs */
#include "H5MFprivate.h" /* File memory management */
+#include "H5MMprivate.h" /* Memory management */
#include "H5Pprivate.h" /* Property lists */
#include "H5SMprivate.h" /* Shared Object Header Messages */
@@ -230,7 +231,7 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5F_super_read(H5F_t *f, hid_t dxpl_id, H5G_loc_t *root_loc)
+H5F_super_read(H5F_t *f, hid_t dxpl_id)
{
uint8_t sbuf[H5F_MAX_SUPERBLOCK_SIZE]; /* Buffer for superblock */
H5P_genplist_t *c_plist; /* File creation property list */
@@ -383,8 +384,9 @@ H5F_super_read(H5F_t *f, hid_t dxpl_id, H5G_loc_t *root_loc)
H5F_addr_decode(f, (const uint8_t **)&p, &shared->extension_addr/*out*/);
H5F_addr_decode(f, (const uint8_t **)&p, &stored_eoa/*out*/);
H5F_addr_decode(f, (const uint8_t **)&p, &shared->driver_addr/*out*/);
- if(H5G_obj_ent_decode(f, (const uint8_t **)&p, root_loc->oloc/*out*/,
- &shared->root_ent/*out*/) < 0)
+
+ /* Decode the symbol table entry */
+ if(H5G_root_ent_decode(f, (const uint8_t **)&p) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "unable to read root symbol entry")
/*
@@ -468,7 +470,6 @@ H5F_super_read(H5F_t *f, hid_t dxpl_id, H5G_loc_t *root_loc)
} /* end if */
} /* end if */
else {
- haddr_t root_addr; /* Address of root group */
uint32_t computed_chksum; /* Computed checksum */
uint32_t read_chksum; /* Checksum read from file */
@@ -499,7 +500,7 @@ H5F_super_read(H5F_t *f, hid_t dxpl_id, H5G_loc_t *root_loc)
H5F_addr_decode(f, (const uint8_t **)&p, &shared->base_addr/*out*/);
H5F_addr_decode(f, (const uint8_t **)&p, &shared->extension_addr/*out*/);
H5F_addr_decode(f, (const uint8_t **)&p, &stored_eoa/*out*/);
- H5F_addr_decode(f, (const uint8_t **)&p, &root_addr/*out*/);
+ H5F_addr_decode(f, (const uint8_t **)&p, &shared->root_addr/*out*/);
/* Compute checksum for superblock */
computed_chksum = H5_checksum_metadata(sbuf, (size_t)(p - sbuf), 0);
@@ -511,11 +512,6 @@ H5F_super_read(H5F_t *f, hid_t dxpl_id, H5G_loc_t *root_loc)
if(read_chksum != computed_chksum)
HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "bad checksum on driver information block")
- /* Create root group object location */
- H5O_loc_reset(root_loc->oloc);
- root_loc->oloc->file = f;
- root_loc->oloc->addr = root_addr;
-
/*
* Check if superblock address is different from base address and
* adjust base address and "end of address" address if so.
@@ -930,7 +926,9 @@ H5F_super_write(H5F_t *f, hid_t dxpl_id)
rel_eoa = H5FD_get_eoa(f->shared->lf, H5FD_MEM_SUPER);
H5F_addr_encode(f, &p, (rel_eoa + f->shared->base_addr));
H5F_addr_encode(f, &p, f->shared->driver_addr);
- if(H5G_obj_ent_encode(f, &p, H5G_oloc(f->shared->root_grp)) < 0)
+
+ /* Encode the root group object entry, including the cached stab info */
+ if(H5G_root_ent_encode(f, &p) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to encode root group information")
/* Encode the driver information block. */