diff mbox series

[3/5] btrfs: add minimal file system size check

Message ID 20210521045825.1720305-4-naohiro.aota@wdc.com (mailing list archive)
State New, archived
Headers show
Series fstests: add checks for testing zoned btrfs | expand

Commit Message

Naohiro Aota May 21, 2021, 4:58 a.m. UTC
Some btrfs tests call _scratch_pool_mkfs or _scratch_mkfs by themselves to
specify file system size limit. It slips through the check in
_scratch_mkfs_sized(). Let's add size check call for each of them.

Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
---
 tests/btrfs/141 | 1 +
 tests/btrfs/142 | 1 +
 tests/btrfs/143 | 1 +
 tests/btrfs/150 | 1 +
 tests/btrfs/151 | 1 +
 tests/btrfs/156 | 1 +
 tests/btrfs/157 | 1 +
 tests/btrfs/158 | 1 +
 tests/btrfs/175 | 1 +
 9 files changed, 9 insertions(+)
diff mbox series

Patch

diff --git a/tests/btrfs/141 b/tests/btrfs/141
index bc4ba52d011d..409cb8ee4099 100755
--- a/tests/btrfs/141
+++ b/tests/btrfs/141
@@ -71,6 +71,7 @@  _scratch_dev_pool_get 2
 # step 1, create a raid1 btrfs which contains one 128k file.
 echo "step 1......mkfs.btrfs" >>$seqres.full
 
+_check_minimal_fs_size $(( 1024 * 1024 * 1024 ))
 mkfs_opts="-d raid1 -b 1G"
 _scratch_pool_mkfs $mkfs_opts >>$seqres.full 2>&1
 
diff --git a/tests/btrfs/142 b/tests/btrfs/142
index c8660fd60e5e..e7170cb4e20b 100755
--- a/tests/btrfs/142
+++ b/tests/btrfs/142
@@ -49,6 +49,7 @@  _scratch_dev_pool_get 2
 # step 1, create a raid1 btrfs which contains one 128k file.
 echo "step 1......mkfs.btrfs" >>$seqres.full
 
+_check_minimal_fs_size $(( 1024 * 1024 * 1024 ))
 mkfs_opts="-d raid1 -b 1G"
 _scratch_pool_mkfs $mkfs_opts >>$seqres.full 2>&1
 
diff --git a/tests/btrfs/143 b/tests/btrfs/143
index 88fdbe60c123..399146063c40 100755
--- a/tests/btrfs/143
+++ b/tests/btrfs/143
@@ -56,6 +56,7 @@  _scratch_dev_pool_get 2
 # step 1, create a raid1 btrfs which contains one 128k file.
 echo "step 1......mkfs.btrfs" >>$seqres.full
 
+_check_minimal_fs_size $(( 1024 * 1024 * 1024 ))
 mkfs_opts="-d raid1 -b 1G"
 _scratch_pool_mkfs $mkfs_opts >>$seqres.full 2>&1
 
diff --git a/tests/btrfs/150 b/tests/btrfs/150
index 0840e0a0cc7d..12826dc0469e 100755
--- a/tests/btrfs/150
+++ b/tests/btrfs/150
@@ -59,6 +59,7 @@  disable_io_failure()
 	echo 0 > $SYSFS_BDEV/make-it-fail
 }
 
+_check_minimal_fs_size $(( 1024 * 1024 * 1024 ))
 _scratch_pool_mkfs "-d raid1 -b 1G" >> $seqres.full 2>&1
 
 # It doesn't matter which compression algorithm we use.
diff --git a/tests/btrfs/151 b/tests/btrfs/151
index cd18f895fd69..d363874f491a 100755
--- a/tests/btrfs/151
+++ b/tests/btrfs/151
@@ -39,6 +39,7 @@  _supported_fs btrfs
 _require_scratch
 _require_scratch_dev_pool 3
 _require_btrfs_dev_del_by_devid
+_check_minimal_fs_size $(( 1024 * 1024 * 1024 ))
 
 # We need exactly 3 disks to form a fixed stripe layout for this test.
 _scratch_dev_pool_get 3
diff --git a/tests/btrfs/156 b/tests/btrfs/156
index 89c80e7161e2..9126dbab1dde 100755
--- a/tests/btrfs/156
+++ b/tests/btrfs/156
@@ -53,6 +53,7 @@  nr_files=$(( $fs_size / $file_size / 2))
 # Force to use single data and meta profile.
 # Since the test relies on fstrim output, which will differ for different
 # profiles
+_check_minimal_fs_size $fs_size
 _scratch_mkfs -b $fs_size -m single -d single > /dev/null
 _scratch_mount
 
diff --git a/tests/btrfs/157 b/tests/btrfs/157
index e7118dbcad0f..e90349b8ce16 100755
--- a/tests/btrfs/157
+++ b/tests/btrfs/157
@@ -76,6 +76,7 @@  _scratch_dev_pool_get 4
 # step 1: create a raid6 btrfs and create a 128K file
 echo "step 1......mkfs.btrfs" >>$seqres.full
 
+_check_minimal_fs_size $(( 1024 * 1024 * 1024 ))
 mkfs_opts="-d raid6 -b 1G"
 _scratch_pool_mkfs $mkfs_opts >>$seqres.full 2>&1
 
diff --git a/tests/btrfs/158 b/tests/btrfs/158
index 803d6b9ea37f..e5bf2f102e15 100755
--- a/tests/btrfs/158
+++ b/tests/btrfs/158
@@ -68,6 +68,7 @@  _scratch_dev_pool_get 4
 # step 1: create a raid6 btrfs and create a 128K file
 echo "step 1......mkfs.btrfs" >>$seqres.full
 
+_check_minimal_fs_size $(( 1024 * 1024 * 1024 ))
 mkfs_opts="-d raid6 -b 1G"
 _scratch_pool_mkfs $mkfs_opts >>$seqres.full 2>&1
 
diff --git a/tests/btrfs/175 b/tests/btrfs/175
index 94f56284a717..75704c43e27d 100755
--- a/tests/btrfs/175
+++ b/tests/btrfs/175
@@ -29,6 +29,7 @@  rm -f $seqres.full
 _supported_fs btrfs
 _require_scratch_dev_pool 2
 _require_scratch_swapfile
+_check_minimal_fs_size $((1024 * 1024 * 1024))
 
 cycle_swapfile() {
 	local sz=${1:-$(($(get_page_size) * 10))}