4 # Test for NULL files problem
5 # test inode size is on disk after fsync
7 #-----------------------------------------------------------------------
8 # Copyright (c) 2006 Silicon Graphics, Inc. All Rights Reserved.
9 #-----------------------------------------------------------------------
15 echo "QA output created by $seq"
19 status=1 # failure is the default!
20 trap "_cleanup; exit \$status" 0 1 2 3 15
27 # get standard environment, filters and checks
31 # real QA test starts here
33 _supported_os Linux IRIX
37 _scratch_mkfs_xfs >/dev/null 2>&1
42 # check file size and contents
47 # if file is missing then fsync failed
50 # if file size is not 32k then fsync failed
51 if [ `stat -c %s $file` -eq 32768 ]
53 # if file has non-zero size but no extents then it's contents will be NULLs, bad.
54 if xfs_bmap $file | grep 'no extents' > /dev/null
56 echo corrupt file $file - non-zero size but no extents
61 echo file $file has incorrect size - fsync failed
64 echo file $file missing - fsync failed
70 # create files and fsync them
75 xfs_io -f -c "pwrite -b 32k -S 0xff 0 32k" -c "fsync" $file > /dev/null
78 echo error creating/writing file $file
84 # shutdown immediately after, then remount and test
85 src/godown $SCRATCH_MNT
89 if [ ! _check_scratch_fs ]
91 echo error detected in filesystem