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
45 xfs_io -f -c "truncate 32k" $file > /dev/null
49 # give the system a chance to write something out
52 src/godown $SCRATCH_MNT
57 # check file size and contents
62 # if file does not exist, the create was not logged, skip it
65 # if file size is zero it cannot be corrupt, skip it
68 # if file has non-zero size but no extents then it's contents will be NULLs, bad.
69 if xfs_bmap $file | grep 'no extents' > /dev/null
71 echo corrupt file $file - non-zero size but no extents
72 elif xfs_bmap $file | grep 'hole' > /dev/null
74 echo corrupt file $file - contains holes