diff --git a/src/blockstore_impl.cpp b/src/blockstore_impl.cpp index 19d05ebf..1ae07da2 100644 --- a/src/blockstore_impl.cpp +++ b/src/blockstore_impl.cpp @@ -105,10 +105,10 @@ void blockstore_impl_t::loop() // has_writes == 1 - some writes in progress // has_writes == 2 - tried to submit some writes, but failed int has_writes = 0, op_idx = 0, new_idx = 0; - for (; op_idx < submit_queue.size(); op_idx++) + for (; op_idx < submit_queue.size(); op_idx++, new_idx++) { auto op = submit_queue[op_idx]; - submit_queue[new_idx++] = op; + submit_queue[new_idx] = op; // FIXME: This needs some simplification // Writes should not block reads if the ring is not full and reads don't depend on them // In all other cases we should stop submission diff --git a/src/blockstore_read.cpp b/src/blockstore_read.cpp index eafe52e7..4b84449d 100644 --- a/src/blockstore_read.cpp +++ b/src/blockstore_read.cpp @@ -191,8 +191,8 @@ int blockstore_impl_t::dequeue_read(blockstore_op_t *read_op) if (bmp_end > bmp_start) { // fill with zeroes - fulfill_read(read_op, fulfilled, bmp_start * bitmap_granularity, - bmp_end * bitmap_granularity, (BS_ST_DELETE | BS_ST_STABLE), 0, 0); + assert(fulfill_read(read_op, fulfilled, bmp_start * bitmap_granularity, + bmp_end * bitmap_granularity, (BS_ST_DELETE | BS_ST_STABLE), 0, 0)); } bmp_start = bmp_end; while (clean_entry_bitmap[bmp_end >> 3] & (1 << (bmp_end & 0x7)) && bmp_end < bmp_size) @@ -218,7 +218,7 @@ int blockstore_impl_t::dequeue_read(blockstore_op_t *read_op) else if (fulfilled < read_op->len) { // fill remaining parts with zeroes - fulfill_read(read_op, fulfilled, 0, block_size, (BS_ST_DELETE | BS_ST_STABLE), 0, 0); + assert(fulfill_read(read_op, fulfilled, 0, block_size, (BS_ST_DELETE | BS_ST_STABLE), 0, 0)); } assert(fulfilled == read_op->len); read_op->version = result_version;