librbd should treat the corruption of the journal differently from
missing journal entries. If entries are missing, it might be the
result of a crash and the journal should just be replayed through
the most recent, consistent entry.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
m_state = STATE_ERROR;
m_journal_metadata->get_finisher().queue(new C_HandleComplete(
- m_replay_handler), -EINVAL);
+ m_replay_handler), -ENOMSG);
return false;
}
}
if (!m_invalid_ranges.empty()) {
- r = -EINVAL;
+ r = -EBADMSG;
}
return r;
}
uint64_t commit_tid;
ASSERT_FALSE(player->try_pop_front(&entry, &commit_tid));
ASSERT_TRUE(wait_for_complete(player));
- ASSERT_NE(0, m_replay_hander.complete_result);
+ ASSERT_EQ(-ENOMSG, m_replay_hander.complete_result);
}
TEST_F(TestJournalPlayer, PrefetchAndWatch) {
C_SaferCond cond;
object->fetch(&cond);
- ASSERT_EQ(-EINVAL, cond.wait());
+ ASSERT_EQ(-EBADMSG, cond.wait());
journal::ObjectPlayer::Entries entries;
object->get_entries(&entries);