Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 621B820349D90 for ; Fri, 17 Nov 2017 12:24:25 -0800 (PST) From: Ross Zwisler Subject: [fstests PATCH v4 2/4] dm-log-writes: only replay log to marks that exist Date: Fri, 17 Nov 2017 13:28:26 -0700 Message-Id: <20171117202828.25472-3-ross.zwisler@linux.intel.com> In-Reply-To: <20171117202828.25472-1-ross.zwisler@linux.intel.com> References: <20171117202828.25472-1-ross.zwisler@linux.intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" To: fstests Cc: Jan Kara , linux-nvdimm , Amir Goldstein , Dave Chinner , linux-xfs List-ID: 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 --- common/dmlogwrites | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/common/dmlogwrites b/common/dmlogwrites index 247c744..80ed4fc 100644 --- a/common/dmlogwrites +++ b/common/dmlogwrites @@ -72,6 +72,10 @@ _log_writes_replay_log() { _mark=$1 + $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" -- 2.9.5 _______________________________________________ Linux-nvdimm mailing list Linux-nvdimm@lists.01.org https://lists.01.org/mailman/listinfo/linux-nvdimm