dm-log-writes: only replay log to marks that exist
authorRoss Zwisler <ross.zwisler@linux.intel.com>
Wed, 6 Dec 2017 00:37:43 +0000 (17:37 -0700)
committerEryu Guan <eguan@redhat.com>
Fri, 8 Dec 2017 04:25:53 +0000 (12:25 +0800)
commit1475bdd1f7b6cd434a6e1f8439b2a8a21111942a
tree527996098bda00338eda586c8ee260a2191a19fa
parent0920e161034a5674a1de8fbdbb505f08c89e10d7
dm-log-writes: only replay log to marks that exist

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@linux.intel.com>
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
common/dmlogwrites