2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2011 Fujitsu. All Rights Reserved.
7 # Check if ctime update caused by chattr is written to disk
10 _begin_fstest auto ioctl quick metadata
12 # Override the default cleanup function.
15 rm -f $SCRATCH_MNT/tmp*
18 # Import common functions.
22 # real QA test starts here
27 _scratch_mkfs > /dev/null 2>&1
30 touch $SCRATCH_MNT/tmp
32 ctime1=`stat -c %z $SCRATCH_MNT/tmp`
35 $CHATTR_PROG +A $SCRATCH_MNT/tmp
36 $CHATTR_PROG -A $SCRATCH_MNT/tmp
37 ctime2=`stat -c %z $SCRATCH_MNT/tmp`
40 ctime3=`stat -c %z $SCRATCH_MNT/tmp`
42 if [ "$ctime1" == "$ctime2" ]; then
43 echo "error: ctime not updated after chattr"
44 elif [ "$ctime1" == "$ctime3" ]; then
45 echo "error: on disk ctime not updated"