Allow incorrectly forbidden BS_OP_LIST in readonly mode

trace-sqes
Vitaliy Filippov 2020-03-06 02:02:39 +03:00
parent e19d9fde5f
commit 844cacd357
2 changed files with 4 additions and 2 deletions

View File

@ -304,7 +304,7 @@ void blockstore_impl_t::enqueue_op(blockstore_op_t *op, bool first)
op->len > block_size-op->offset ||
(op->len % disk_alignment)
)) ||
readonly && op->opcode != BS_OP_READ ||
readonly && op->opcode != BS_OP_READ && op->opcode != BS_OP_LIST ||
first && op->opcode == BS_OP_WRITE)
{
// Basic verification not passed

View File

@ -509,7 +509,9 @@ int blockstore_init_journal::handle_journal_part(void *buf, uint64_t done_pos, u
if (data_crc32 != je->small_write.crc32_data)
{
// journal entry is corrupt, stop here
// interesting thing is that we must clear the corrupt entry if we're not readonly
// interesting thing is that we must clear the corrupt entry if we're not readonly,
// because we don't write next entries in the same journal block
printf("Journal entry data is corrupt (data crc32 %x != %x)\n", data_crc32, je->small_write.crc32_data);
memset(buf + proc_pos - done_pos + pos, 0, bs->journal.block_size - pos);
bs->journal.next_free = prev_free;
init_write_buf = buf + proc_pos - done_pos;