[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) if (actual == count)
break; break;
// The block may be on the dirty list from a prior // We can't writeback anything that's still in use.
// acquisition. if (!it->ref_count_) {
if (it->ref_count_) issue_write(*it);
continue; actual++;
}
issue_write(*it);
actual++;
it = next; it = next;
} }