From 6f760ccd87361e6c585dfc638c63110b697081a6 Mon Sep 17 00:00:00 2001 From: Joe Thornber Date: Thu, 21 Aug 2014 14:22:14 +0100 Subject: [PATCH] [block-cache] When changing validators the new validator check fn was only being called if the block was dirty. --- block-cache/block_cache.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/block-cache/block_cache.cc b/block-cache/block_cache.cc index 5bb9bfe..51c669b 100644 --- a/block-cache/block_cache.cc +++ b/block-cache/block_cache.cc @@ -564,10 +564,9 @@ block_cache::lookup_or_read_block(block_address index, unsigned flags, if (flags & GF_ZERO) zero_block(*b); else { - if (b->v_.get() && - b->v_.get() != v.get() && - b->test_flags(BF_DIRTY)) { - b->v_->prepare(b->data_, b->index_); + if (b->v_.get() != v.get()) { + if (b->test_flags(BF_DIRTY)) + b->v_->prepare(b->data_, b->index_); v->check(b->data_, b->index_); } }