4 # Test for NULL files problem
5 # test inode size is on disk after sync
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 sync failed
50 # if file size is not 10MB then sync failed
51 if [ `stat -c %s $file` -eq 10485760 ]
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 - sync failed
64 echo file $file missing - sync failed
70 # create files and sync them
75 xfs_io -f -c "pwrite -b 64k -S 0xff 0 10m" $file > /dev/null
79 # sync, then shutdown immediately after, then remount and test
81 src/godown $SCRATCH_MNT