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 does not exist, the create was not logged, skip it
50 # if file size is zero then fsync failed
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 zero size - sync failed
68 # create files and fsync them
73 xfs_io -f -c "pwrite -b 32k -S 0xff 0 32k" -c "fsync" $file > /dev/null
77 # shutdown immediately after, then remount and test
78 src/godown $SCRATCH_MNT