[block-cache] writeback could get stuck in a loop

If a block had a non zero ref count.
This commit is contained in:
Joe Thornber 2017-08-14 10:40:41 +01:00
parent dfd066e59e
commit a45ffd896a

View File

@ -265,13 +265,11 @@ block_cache::writeback(unsigned count)
if (actual == count)
break;
// The block may be on the dirty list from a prior
// acquisition.
if (it->ref_count_)
continue;
// We can't writeback anything that's still in use.
if (!it->ref_count_) {
issue_write(*it);
actual++;
}
it = next;
}