From b493a30b650c295e370533860b80f52c1ce0edc7 Mon Sep 17 00:00:00 2001 From: Joe Thornber Date: Thu, 21 Aug 2014 14:23:14 +0100 Subject: [PATCH] [block-cache] tweak when validators are swapped Makes it more consitent in the face of exceptions --- block-cache/block_cache.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/block-cache/block_cache.cc b/block-cache/block_cache.cc index 51c669b..6ecce1f 100644 --- a/block-cache/block_cache.cc +++ b/block-cache/block_cache.cc @@ -577,8 +577,6 @@ block_cache::lookup_or_read_block(block_address index, unsigned flags, b = new_block(index); if (b) { - b->v_ = v; - if (flags & GF_ZERO) zero_block(*b); else { @@ -586,6 +584,8 @@ block_cache::lookup_or_read_block(block_address index, unsigned flags, wait_specific(*b); v->check(b->data_, b->index_); } + + b->v_ = v; } }