4 # Test for NULL files problem
5 # test inode size is on disk after sync - expose log replay bug
7 #-----------------------------------------------------------------------
8 # Copyright (c) 2006 Silicon Graphics, Inc. All Rights Reserved.
10 # This program is free software; you can redistribute it and/or
11 # modify it under the terms of the GNU General Public License as
12 # published by the Free Software Foundation.
14 # This program is distributed in the hope that it would be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with this program; if not, write the Free Software Foundation,
21 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23 #-----------------------------------------------------------------------
27 seqres=$RESULT_DIR/$seq
28 echo "QA output created by $seq"
32 status=1 # failure is the default!
33 trap "exit \$status" 0 1 2 3 15
35 # get standard environment, filters and checks
39 # real QA test starts here
41 _supported_os Linux IRIX
44 _require_scratch_shutdown
46 _scratch_mkfs >/dev/null 2>&1
51 # check file size and contents
56 # if file is missing then sync failed
59 # if file size is not 32KB then sync failed
60 if [ `ls -l $file | tr -s ' ' | cut -d ' ' -f 5` -eq 32768 ]
62 # if file has non-zero size but no extents then it's contents will be NULLs, bad.
63 num_extents=`_count_extents $file`
64 if [ $num_extents -eq 0 ]; then
65 echo corrupt file $file - non-zero size but no extents
70 echo file $file has incorrect size - sync failed
73 echo file $file missing - sync failed
79 # create files and sync them
84 $XFS_IO_PROG -f -c "pwrite -b 32k -S 0xff 0 32k" $file > /dev/null
87 echo error creating/writing file $file
93 # sync, then shutdown immediately after, then remount and test
95 src/godown $SCRATCH_MNT
99 if [ ! _check_scratch_fs ]
101 echo error detected in filesystem