linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sidong Yang <realwakka@gmail.com>
To: linux-btrfs@vger.kernel.org, fstests@vger.kernel.org
Cc: Sidong Yang <realwakka@gmail.com>
Subject: [PATCH] btrfs/012: check free size of scratch device before copying files
Date: Sun, 23 May 2021 05:08:59 +0000	[thread overview]
Message-ID: <20210523050859.1329427-1-realwakka@gmail.com> (raw)

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


                 reply	other threads:[~2021-05-23  5:09 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210523050859.1329427-1-realwakka@gmail.com \
    --to=realwakka@gmail.com \
    --cc=fstests@vger.kernel.org \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).