2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2000-2002 Silicon Graphics, Inc. All Rights Reserved.
7 # check out-of-space behaviour
10 _begin_fstest other auto quick enospc
12 # Import common functions.
15 # Override the default cleanup function.
23 _df_dir $SCRATCH_MNT | $AWK_PROG '{ print $5 }'
26 # real QA test starts here
30 _require_no_large_scratch_dev
32 # btrfs needs at least 256MB (with upward round off) to create a non-mixed mode
33 # fs. Ref: btrfs-progs: btrfs_min_dev_size()
34 _scratch_mkfs_sized $((256 * 1024 * 1024)) >> $seqres.full 2>&1 \
35 || _fail "mkfs failed"
37 out=$SCRATCH_MNT/fillup.$$
42 echo " *** failed to get free space (0)"
45 echo "free space at start $free0" >> $seqres.full
47 echo "fill disk:" # well, filesystem really - not disk
49 POSIXLY_CORRECT=yes dd if=/dev/zero of=$out bs=1024k 2>&1 | _filter_dd
51 echo "check free space:"
56 echo " *** failed to get free space (1)"
59 echo "free space after fill $free1" >> $seqres.full
63 echo " *** file not created"
69 echo " *** file created with zero length"
78 echo " *** file not deleted"
84 echo " *** file still exists"
89 echo "check free space:"
96 echo " *** failed to get free space (2)"
99 echo "free space after delete $free2" >> $seqres.full
102 _within_tolerance "free space" $free2 $free0 1% -v