mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
btrfs/022: fix failed case with qgroup limit test
To have noexceed test, we should clear data before and then retry. However, when we are near to quota limit, we may fail to truncate/remove data before, so we restart everthing here. Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
This commit is contained in:
committed by
Dave Chinner
parent
3128e9c55d
commit
d1d43f623e
+17
-3
@@ -94,8 +94,8 @@ _rescan_test()
|
||||
_fail "exclusive values don't match after rescan"
|
||||
}
|
||||
|
||||
#basic limit testing
|
||||
_limit_test()
|
||||
#basic exceed limit testing
|
||||
_limit_test_exceed()
|
||||
{
|
||||
run_check $BTRFS_UTIL_PROG subvol create $SCRATCH_MNT/a
|
||||
run_check $BTRFS_UTIL_PROG quota enable $SCRATCH_MNT
|
||||
@@ -104,6 +104,15 @@ _limit_test()
|
||||
dd if=/dev/urandom of=$SCRATCH_MNT/a/file bs=10M count=1 >> \
|
||||
$seqres.full 2>&1
|
||||
[ $? -ne 0 ] || _fail "quota should have limited us"
|
||||
}
|
||||
|
||||
#basic noexceed limit testing
|
||||
_limit_test_noexceed()
|
||||
{
|
||||
run_check $BTRFS_UTIL_PROG subvol create $SCRATCH_MNT/a
|
||||
run_check $BTRFS_UTIL_PROG quota enable $SCRATCH_MNT
|
||||
subvolid=$(_btrfs_get_subvolid $SCRATCH_MNT a)
|
||||
run_check $BTRFS_UTIL_PROG qgroup limit 5M 0/$subvolid $SCRATCH_MNT
|
||||
dd if=/dev/urandom of=$SCRATCH_MNT/a/file bs=4M count=1 >> \
|
||||
$seqres.full 2>&1
|
||||
[ $? -eq 0 ] || _fail "should have been allowed to write"
|
||||
@@ -121,7 +130,12 @@ _scratch_unmount
|
||||
|
||||
_scratch_mkfs > /dev/null 2>&1
|
||||
_scratch_mount
|
||||
_limit_test
|
||||
_limit_test_exceed
|
||||
_scratch_unmount
|
||||
|
||||
_scratch_mkfs > /dev/null 2>&1
|
||||
_scratch_mount
|
||||
_limit_test_noexceed
|
||||
|
||||
# success, all done
|
||||
echo "Silence is golden"
|
||||
|
||||
Reference in New Issue
Block a user