create_file may run over before growfs, which depends on many reasons. such as
the schedule algorithm, the workload of testing machine, etc. we should always
make sure the create_file run over after growfs, then we can get the valid
result of this test.
Signed-off-by: George Wang <xuw2015@gmail.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
{
local dir=$1
local i=0
-
- while echo -n >$dir/testfile_$i; do
- let i=$i+1
+ local in_growfs=false
+
+ # keep running until failed after growfs
+ while true; do
+ [ -f $tmp.growfs ] && in_growfs=true
+ while echo -n >$dir/testfile_$i; do
+ let i=$i+1
+ done
+ $in_growfs && break
+ usleep 1000
done
}
echo "Grow fs to $((dblocks * 4)) blocks" >>$seqres.full
$XFS_GROWFS_PROG -D $((dblocks * 4)) $SCRATCH_MNT >>$seqres.full
+# mark xfs_growfs finished to create_file
+touch $tmp.growfs
+
# Wait for background create_file to hit ENOSPC
wait