From 442e460055fdf045cc70c87fac9f0dd481ad55e2 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sun, 8 Jun 2014 16:43:22 +0900 Subject: [PATCH] Fix bug that zero length file is not opened when flushing cache This bug was only seen when MultiDiskAdaptor was used. --- src/MultiDiskAdaptor.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/MultiDiskAdaptor.cc b/src/MultiDiskAdaptor.cc index 3ca64356..825b04cc 100644 --- a/src/MultiDiskAdaptor.cc +++ b/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((*i)->goff + celloff)) <