linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] btrfs/012: check free size of scratch device before copying files
@ 2021-05-23  5:08 Sidong Yang
  0 siblings, 0 replies; only message in thread
From: Sidong Yang @ 2021-05-23  5:08 UTC (permalink / raw)
  To: linux-btrfs, fstests; +Cc: Sidong Yang

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.

Signed-off-by: Sidong Yang <realwakka@gmail.com>
---
 tests/btrfs/012 | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tests/btrfs/012 b/tests/btrfs/012
index fd43da53..6979d862 100755
--- a/tests/btrfs/012
+++ b/tests/btrfs/012
@@ -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`
-- 
2.25.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-05-23  5:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-05-23  5:08 [PATCH] btrfs/012: check free size of scratch device before copying files Sidong Yang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).