summaryrefslogtreecommitdiffstats
path: root/src/H5FDlog.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2001-05-02 15:04:55 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2001-05-02 15:04:55 (GMT)
commit076efa3382acdff44b9560909c9c28832c0ff1fe (patch)
tree822177177ff8eecd0ef1e2f64236352ea73059b8 /src/H5FDlog.c
parentf21aa7af8ccc49e57156e2d0f99eb2770f837517 (diff)
downloadhdf5-076efa3382acdff44b9560909c9c28832c0ff1fe.zip
hdf5-076efa3382acdff44b9560909c9c28832c0ff1fe.tar.gz
hdf5-076efa3382acdff44b9560909c9c28832c0ff1fe.tar.bz2
[svn-r3885] Purpose:
Document bug fix Description: IMPORTANT! IMPORTANT! IMPORTANT! A case where metadata in a file could get corrupted in certain unusual sitations was detected and fixed. In certain circumstances, metadata could get cached in the raw data cache, and if that particular piece of metadata was updated on disk while incorrectly cached, the new metadata would get overwritten with the stale metadata from the raw data cache when it was flushed out. Additionally, I've patched up the raw data cache to be smarter about how much it caches and how much I/O it triggers, leading to some speedups. Solution: Changed the raw data I/O routines which perform caching to require a parameter with the size of the dataset being accessed and limited the cache to no more than that many bytes. Platforms tested: FreeBSD 4.3 (hawkwind)
Diffstat (limited to 'src/H5FDlog.c')
-rw-r--r--src/H5FDlog.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/H5FDlog.c b/src/H5FDlog.c
index 86b3159..e025456 100644
--- a/src/H5FDlog.c
+++ b/src/H5FDlog.c
@@ -30,7 +30,7 @@
#endif /* MAX */
/* The size of the buffer to track allocation requests */
-#define TRACK_BUFFER 5000000
+#define TRACK_BUFFER 15000000
/* The driver identification number, initialized at runtime */
static hid_t H5FD_LOG_g = 0;
@@ -677,8 +677,8 @@ H5FD_log_alloc(H5FD_t *_file, H5FD_mem_t type, hsize_t size)
FUNC_ENTER(H5FD_log_alloc, HADDR_UNDEF);
- addr = file->eoa;
- file->eoa += size;
+ addr = file->eoa;
+ file->eoa += size;
#ifdef QAK
printf("%s: flavor=%s, size=%lu\n",FUNC,flavors[type],(unsigned long)size);
@@ -912,10 +912,12 @@ H5FD_log_write(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, hadd
FUNC_ENTER(H5FD_log_write, FAIL);
assert(file && file->pub.cls);
+ assert(size>0);
assert(buf);
/* Verify that we are writing out the type of data we allocated in this location */
- assert(type==file->flavor[addr]);
+ assert(type==H5FD_MEM_DEFAULT || type==file->flavor[addr] || file->flavor[addr]==H5FD_MEM_DEFAULT);
+ assert(type==H5FD_MEM_DEFAULT || type==file->flavor[(addr+size)-1] || file->flavor[(addr+size)-1]==H5FD_MEM_DEFAULT);
/* Check for overflow conditions */
if (HADDR_UNDEF==addr)
@@ -939,8 +941,12 @@ H5FD_log_write(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, hadd
HDfprintf(file->logfp,"Seek: From %10a To %10a\n",file->pos,addr);
/* Log information about the write */
- if(file->fa.verbosity>0)
+ if(file->fa.verbosity>0) {
+ /* Check if this is the first write into a "default" section, grabbed by the metadata agregation algorithm */
+ if(file->flavor[addr]==H5FD_MEM_DEFAULT)
+ HDmemset(&file->flavor[addr],type,(size_t)size);
HDfprintf(file->logfp,"%10a-%10a (%10lu bytes) Written, flavor=%s\n",addr,addr+size-1,(unsigned long)size,flavors[file->flavor[addr]]);
+ } /* end if */
}
/* Seek to the correct location */