diff --git a/src/blockstore_read.cpp b/src/blockstore_read.cpp index 06679a68..a1071226 100644 --- a/src/blockstore_read.cpp +++ b/src/blockstore_read.cpp @@ -139,7 +139,7 @@ int blockstore_impl_t::dequeue_read(blockstore_op_t *read_op) while (dirty_it->first.oid == read_op->oid) { dirty_entry& dirty = dirty_it->second; - bool version_ok = read_op->version >= dirty_it->first.version; + bool version_ok = !IS_IN_FLIGHT(dirty.state) && read_op->version >= dirty_it->first.version; if (IS_SYNCED(dirty.state)) { if (!version_ok && read_op->version != 0) @@ -174,7 +174,7 @@ int blockstore_impl_t::dequeue_read(blockstore_op_t *read_op) dirty_it--; } } - if (clean_it != clean_db.end()) + if (clean_found) { if (!result_version) { diff --git a/src/blockstore_write.cpp b/src/blockstore_write.cpp index 2274cbbc..689b5d8d 100644 --- a/src/blockstore_write.cpp +++ b/src/blockstore_write.cpp @@ -139,7 +139,7 @@ bool blockstore_impl_t::enqueue_write(blockstore_op_t *op) uint8_t *bmp_ptr = (uint8_t*)(dsk.clean_entry_bitmap_size > sizeof(void*) ? bmp : &bmp); uint32_t bit = op->offset/dsk.bitmap_granularity; uint32_t bits_left = op->len/dsk.bitmap_granularity; - while (!(bit % 8) && bits_left > 8) + while (!(bit % 8) && bits_left >= 8) { // Copy bytes bmp_ptr[bit/8] = ((uint8_t*)op->bitmap)[bit/8];