There were two reasons why test 273 was failing. Firstrly, when running on
ext4 fs it was removing everything from SCRATCH_MNT directory at the beginning
of tests including the lost+found directory. This caused error while checking
scratch fs after finishing test. Secondly, obtaining of the partition size was
not counting with with behaviour of df utility which may split the line containg
informations about one partition when it is too long thus it may have returned
nothing.
First problem was solved with removing all unnecessary rm -rf commands and the
second one was fixed with alternative awk script which is able to deal with
any line splitting possible. Also 'umount $SCRATCH_DEV' was substituted for
'_scratch_unmount'.
Cc: sandeen@sandeen.net
Signed-off-by: Tom Marek <tmarek@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
_cleanup()
{
cd /
- rm -rf $SCRATCH_MNT/* $tmp.*
+ rm -rf $tmp.*
_scratch_unmount
}
cd $SCRATCH_MNT/origin
- _disksize=`df --block-size=1 | grep $SCRATCH_DEV | awk '{print $2}'`
+ _disksize=`df --block-size=1 $SCRATCH_DEV | awk -v sd=$SCRATCH_DEV 'BEGIN{c=0}{for(i=1;i<=NF;++i){a[c]=$i;++c}}END{for(entry in a){if(a[entry] ~ sd){print a[entry + 3]; break}}}'`
_disksize=$(($_disksize / 3))
_num=$(($_disksize / $count / $threads / 4096))
_count=$count
_pids=""
_pid=1
- rm -rf $SCRATCH_MNT/*
-
_threads_set
_file_create
rm -f $seq.full
-umount $SCRATCH_DEV 2>/dev/null
+_scratch_unmount 2>/dev/null
_scratch_mkfs_sized $((2 * 1024 * 1024 * 1024)) >>$seq.full 2>&1
_scratch_mount