2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2017 Christoph Hellwig. All Rights Reserved.
7 # Verify that mtime is not updated when deduping files.
10 seqres=$RESULT_DIR/$seq
11 echo "QA output created by $seq"
15 trap "_cleanup; exit \$status" 0 1 2 3 15
24 # get standard environment, filters and checks
29 # real QA test starts here
35 echo "Silence is golden."
39 sourcefile=$TEST_DIR/dedup_mtime_sourcefile
40 $XFS_IO_PROG -f -c "pwrite 0 4k" -c fsync $sourcefile >> $seqres.full
42 destfile=$TEST_DIR/dedup_mtime_destfile
43 $XFS_IO_PROG -f -c "pwrite 0 4k" -c fsync $destfile >> $seqres.full
46 mtime1=`stat -c %Y $destfile`
47 ctime1=`stat -c %Z $destfile`
48 echo "before dedup: $mtime1 $ctime1" >> $seqres.full
50 # dedup to trigger timestamp change
52 _dedupe_range $sourcefile 0 $destfile 0 "4k" >> $seqres.full
54 # sample and verify that timestamps have changed.
55 mtime2=`stat -c %Y $destfile`
56 ctime2=`stat -c %Z $destfile`
57 echo "after dedup : $mtime2 $ctime2" >> $seqres.full
59 if [ "$mtime1" != "$mtime2" ]; then
63 if [ "$ctime1" != "$ctime2" ]; then