From 4e28efd925214dd60ddc02b8fa3a8c1128bc0fec Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sun, 7 Sep 2008 11:37:15 +0000 Subject: 2008-09-07 Tatsuhiro Tsujikawa Fixed the bug that DiskWriterEntry is not created when its FileEntry.isRequested() is false and it doesn't share a piece with other FileEntries that are requested. This bug causes segmentation fault in the end. --- src/MultiFileAllocationIterator.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/MultiFileAllocationIterator.cc') diff --git a/src/MultiFileAllocationIterator.cc b/src/MultiFileAllocationIterator.cc index 1f541361..7fcb7b3e 100644 --- a/src/MultiFileAllocationIterator.cc +++ b/src/MultiFileAllocationIterator.cc @@ -61,7 +61,7 @@ void MultiFileAllocationIterator::allocateChunk() _diskAdaptor->openIfNot(entry, &DiskWriterEntry::openFile, _diskAdaptor->getTopDirPath()); entry->enableDirectIO(); - if(entry->size() < fileEntry->getLength()) { + if(entry->needsFileAllocation() && entry->size() < fileEntry->getLength()) { // Calling private function of MultiDiskAdaptor. _fileAllocationIterator.reset (new SingleFileAllocationIterator(entry->getDiskWriter().get(), -- cgit