4 # Test for NULL files problem
6 #-----------------------------------------------------------------------
7 # Copyright (c) 2006 Silicon Graphics, Inc. All Rights Reserved.
8 #-----------------------------------------------------------------------
14 echo "QA output created by $seq"
18 status=1 # failure is the default!
19 trap "_cleanup; exit \$status" 0 1 2 3 15
26 # get standard environment, filters and checks
30 # real QA test starts here
32 _supported_os Linux IRIX
36 _scratch_mkfs_xfs >/dev/null 2>&1
44 xfs_io -f -c "pwrite -b 64k -S 0xff 0 64k" $file > /dev/null
48 # give the system a chance to write something out
51 src/godown $SCRATCH_MNT
56 # check file size and contents
61 # if file does not exist, the create was not logged, skip it
64 # if file size is zero it cannot be corrupt, skip it
67 # if file has non-zero size but no extents then it's contents will be NULLs, bad.
68 if xfs_bmap $file | grep 'no extents' > /dev/null
70 echo corrupt file $file - non-zero size but no extents
71 elif xfs_bmap $file | grep 'hole' > /dev/null
73 echo corrupt file $file - contains holes