浏览代码

Fix bug that zero length file is not opened when flushing cache

This bug was only seen when MultiDiskAdaptor was used.
Tatsuhiro Tsujikawa 11 年之前
父节点
当前提交
442e460055
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      src/MultiDiskAdaptor.cc

+ 3 - 0
src/MultiDiskAdaptor.cc

@@ -405,6 +405,9 @@ void MultiDiskAdaptor::writeCache(const WrDiskCacheEntry* entry)
   for(; dent != eod; ++dent) {
     int64_t lstart = 0, lp = 0;
     auto& fent = (*dent)->getFileEntry();
+    if(fent->getLength() == 0) {
+      continue;
+    }
     for(; i != eoi;) {
       if(std::max(fent->getOffset(),
                   static_cast<int64_t>((*i)->goff + celloff)) <