Skip to content
Snippets Groups Projects
Commit 280f9fb7 authored by Gerardo Ganis's avatar Gerardo Ganis Committed by Philippe Canal
Browse files

io/io: fix for ROOT-8516 (corruption in file writing)

When the write-cache required flushing to file and the length of the buffer
to be written exceed the size of the cache buffer, requiring
direct-write-to-file, the offset (seek position) was incorrectly left to
the one of the last basket in the flushed cache.
parent 92147dee
No related branches found
No related tags found
No related merge requests found
...@@ -133,6 +133,7 @@ Int_t TFileCacheWrite::WriteBuffer(const char *buf, Long64_t pos, Int_t len) ...@@ -133,6 +133,7 @@ Int_t TFileCacheWrite::WriteBuffer(const char *buf, Long64_t pos, Int_t len)
if (len >= fBufferSize) { if (len >= fBufferSize) {
//buffer larger than the cache itself: direct write to file //buffer larger than the cache itself: direct write to file
fRecursive = kTRUE; fRecursive = kTRUE;
fFile->Seek(pos); // Flush may have changed this
if (fFile->WriteBuffer(buf,len)) return -1; // failure if (fFile->WriteBuffer(buf,len)) return -1; // failure
fRecursive = kFALSE; fRecursive = kFALSE;
return 1; return 1;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment