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
40 # Do we have enough space on disk?
41 FREE_BLOCKS=`df -klP $SCRATCH_MNT | grep -v Filesystem | awk '{print $4}'`
42 [ $FREE_BLOCKS -lt 10485760 ] && _notrun "This test requires at least 10GB of \
47 # check file size and contents
52 # if file is missing then sync failed
55 # if file size is not 10MB then sync failed
56 if [ `ls -l $file | tr -s ' ' | cut -d ' ' -f 5` -eq 10485760 ]
58 # if file has non-zero size but no extents then it's contents will be NULLs, bad.
59 if xfs_bmap $file | grep 'no extents' > /dev/null
61 echo corrupt file $file - non-zero size but no extents
66 echo file $file has incorrect size - sync failed
69 echo file $file missing - sync failed
75 # create files and sync them
80 xfs_io -f -c "pwrite -b 64k -S 0xff 0 10m" $file > /dev/null
83 echo error creating/writing file $file
89 # sync, then shutdown immediately after, then remount and test
91 src/godown $SCRATCH_MNT
95 if [ ! _check_scratch_fs ]
97 echo error detected in filesystem