3 #-----------------------------------------------------------------------
4 # Copyright (c) 2006 Silicon Graphics, Inc. All Rights Reserved.
6 # This program is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU General Public License as
8 # published by the Free Software Foundation.
10 # This program is distributed in the hope that it would be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write the Free Software Foundation,
17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 #-----------------------------------------------------------------------
23 # Test for NULL files problem
24 # test inode size is on disk after sync
30 echo "QA output created by $seq"
34 status=1 # failure is the default!
35 trap "_cleanup; exit \$status" 0 1 2 3 15
42 # get standard environment, filters and checks
46 # real QA test starts here
48 _supported_os Linux IRIX
52 _scratch_mkfs_xfs >/dev/null 2>&1
55 # Do we have enough space on disk?
56 FREE_BLOCKS=`df -klP $SCRATCH_MNT | grep -v Filesystem | awk '{print $4}'`
57 [ $FREE_BLOCKS -lt 10485760 ] && _notrun "This test requires at least 10GB of \
62 # check file size and contents
67 # if file is missing then sync failed
70 # if file size is not 10MB then sync failed
71 if [ `ls -l $file | tr -s ' ' | cut -d ' ' -f 5` -eq 10485760 ]
73 # if file has non-zero size but no extents then it's contents will be NULLs, bad.
74 if xfs_bmap $file | grep 'no extents' > /dev/null
76 echo corrupt file $file - non-zero size but no extents
81 echo file $file has incorrect size - sync failed
84 echo file $file missing - sync failed
90 # create files and sync them
95 xfs_io -f -c "pwrite -b 64k -S 0xff 0 10m" $file > /dev/null
98 echo error creating/writing file $file
104 # sync, then shutdown immediately after, then remount and test
106 src/godown $SCRATCH_MNT
110 if [ ! _check_scratch_fs ]
112 echo error detected in filesystem