From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org ([65.50.211.133]:50106 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752990AbdBCJ6y (ORCPT ); Fri, 3 Feb 2017 04:58:54 -0500 From: Christoph Hellwig Subject: [PATCH 2/2] generic/408: check that destination timestamps are not updated on dedupe Date: Fri, 3 Feb 2017 10:58:39 +0100 Message-Id: <20170203095839.8007-3-hch@lst.de> In-Reply-To: <20170203095839.8007-1-hch@lst.de> References: <20170203095839.8007-1-hch@lst.de> Sender: fstests-owner@vger.kernel.org To: fstests@vger.kernel.org Cc: Christoph Hellwig List-ID: Signed-off-by: Christoph Hellwig > $seqres.full + +destfile=$TEST_DIR/dedup_mtime_destfile +$XFS_IO_PROG -f -c "pwrite 0 4k" -c fsync $destfile >> $seqres.full + +# sample timestamps. +mtime1=`stat -c %Y $destfile` +ctime1=`stat -c %Z $destfile` +echo "before dedup: $mtime1 $ctime1" >> $seqres.full + +# dedup to trigger timestamp change +sleep 1 +_dedupe_range $sourcefile 0 $destfile 0 "4k" >> $seqres.full + +# sample and verify that timestamps have changed. +mtime2=`stat -c %Y $destfile` +ctime2=`stat -c %Z $destfile` +echo "after dedup : $mtime2 $ctime2" >> $seqres.full + +if [ "$mtime1" != "$mtime2" ]; then + echo "mtime updated" + let status=$status+1 +fi +if [ "$ctime1" != "$ctime2" ]; then + echo "ctime updated" + let status=$status+1 +fi + +exit diff --git a/tests/generic/408.out b/tests/generic/408.out new file mode 100644 index 00000000..29ec47a8 --- /dev/null +++ b/tests/generic/408.out @@ -0,0 +1,2 @@ +QA output created by 408 +Silence is golden. diff --git a/tests/generic/group b/tests/generic/group index 72d6b3cb..740ce45b 100644 --- a/tests/generic/group +++ b/tests/generic/group @@ -410,3 +410,4 @@ 405 auto mkfs 406 auto quick dangerous 407 auto quick clone metadata +408 auto quick clone dedupe metadata -- 2.11.0