The 'replay-log' executable will replay the dm-log-writes log until the
given mark, or until the end of the log if the mark isn't found.
This means that if the mark you're looking for was never inserted in the
log or if you give garbage to _log_writes_replay_log() the entire log will
be replayed. This can cause unexpected test results.
Fix this by making sure that the mark we're given actually exists in the
log before we allow the replay.
Signed-off-by: Ross Zwisler <ross.zwisler(a)linux.intel.com>
common/dmlogwrites | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/common/dmlogwrites b/common/dmlogwrites
index 247c744..80ed4fc 100644
@@ -72,6 +72,10 @@ _log_writes_replay_log()
+ $here/src/log-writes/replay-log --log $LOGWRITES_DEV --find \
+ --end-mark $_mark >> $seqres.full 2>&1
+ [ $? -ne 0 ] && _fail "mark does not exist"
$here/src/log-writes/replay-log --log $LOGWRITES_DEV --replay $SCRATCH_DEV \
--end-mark $_mark >> $seqres.full 2>&1
[ $? -ne 0 ] && _fail "replay failed"