Skip to contentSkip to conversation

btrfs/012: check free size of scratch device before copying files

PATCH New Sidong Yang 1 participant 1 message May 23, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 btrfs/012: check free size of scratch device before copying files

This test failed when scratch device don't have enough space for copying files. This patch gets size of files by du command and checks if there is enough space in the device.

---
 tests/btrfs/012 | 2 ++
 1 file changed, 2 insertions(+)
tests/btrfs/012 +2 -0
index fd43da53..6979d862 100755
@@ -42,6 +42,8 @@ _require_command "$BTRFS_CONVERT_PROG" btrfs-convert
 _require_command "$MKFS_EXT4_PROG" mkfs.ext4
 _require_command "$E2FSCK_PROG" e2fsck
 
+_require_fs_space $SCRATCH_MNT $(du -s /lib/modules/`uname -r` | awk '{print $1}')
+
 rm -f $seqres.full
 
 BLOCK_SIZE=`_get_block_size $TEST_DIR`
Signature · 1 line
2.25.1