[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
1 changed files with 5 additions and 7 deletions

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;
issue_write(*it);
actual++;
// We can't writeback anything that's still in use.
if (!it->ref_count_) {
issue_write(*it);
actual++;
}
it = next;
}