Skip to content

Commit f93de21

Browse files
committed
btrfs-progs: fsck-tests: add a new test case for squota lowmem false
alerts The new test script will fill a btrfs with squota enabled: - A file with regular data extents - A file with preallocated extents - Several files with inline extents to bump up the tree level - Snapshot of a subvolume containing above files Then run btrfs check to verify no error is found. Signed-off-by: Qu Wenruo <wqu@suse.com>
1 parent f3005a9 commit f93de21

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/bash
2+
#
3+
# Make sure "btrfs check" can handle EXTENT_OWNER_REF key type for squota
4+
#
5+
6+
source "$TEST_TOP/common" || exit
7+
8+
check_prereq btrfs
9+
check_prereq mkfs.btrfs
10+
check_global_prereq fallocate
11+
12+
if [ ! -f /sys/fs/btrfs/features/simple_quota ] ; then
13+
_not_run "no kernel simple quota support"
14+
fi
15+
16+
setup_root_helper
17+
prepare_test_dev
18+
19+
run_check_mkfs_test_dev -O squota
20+
run_check_mount_test_dev
21+
run_check $SUDO_HELPER "$TOP/btrfs" subvolume create "$TEST_MNT/subv1"
22+
run_check $SUDO_HELPER dd if=/dev/zero bs=1M count=1 of="$TEST_MNT/subv1/regular"
23+
run_check $SUDO_HELPER fallocate -l 8m "$TEST_MNT/subv1/preallocated"
24+
for ((i = 0; i < 64; i++)); do
25+
run_check $SUDO_HELPER dd if=/dev/urandom bs=1K count=1 of="$TEST_MNT/subv1/inline_$i"
26+
done
27+
28+
run_check $SUDO_HELPER "$TOP/btrfs" subvolume snapshot "$TEST_MNT/subv1" "$TEST_MNT/snap1"
29+
run_check_umount_test_dev
30+
31+
run_check $SUDO_HELPER "$TOP/btrfs" check "$TEST_DEV"

0 commit comments

Comments
 (0)