4 # Check ctime updated or not if file linked
5 # See also http://marc.info/?l=linux-btrfs&m=127434439020230&w=2
7 #-----------------------------------------------------------------------
8 # Copyright (c) 2010 FUJITSU LIMITED. All Rights Reserved.
10 # This program is free software; you can redistribute it and/or
11 # modify it under the terms of the GNU General Public License as
12 # published by the Free Software Foundation.
14 # This program is distributed in the hope that it would be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with this program; if not, write the Free Software Foundation,
21 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23 #-----------------------------------------------------------------------
26 owner=shiwh@cn.fujitsu.com
29 echo "QA output created by $seq"
37 status=1 # failure is the default!
38 trap "_cleanup; exit \$status" 0 1 2 3 15
40 # get standard environment, filters and checks
43 # real QA test starts here
45 # only Linux supports fallocate
50 # create a file and get its ctime
52 ctime=`stat -c %Z $TEST_DIR/ouch`
55 # create a link to a file and get existing file's ctime
56 link $TEST_DIR/ouch $TEST_DIR/ouch2
57 ctime2=`stat -c %Z $TEST_DIR/ouch`
60 if [ $ctime2 -le $ctime ]; then
61 echo "ctime: $ctime -> $ctime2 "
62 echo "Fatal error: ctime not updated after link"