All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eryu Guan <guaneryu@gmail.com>
To: Gwendal Grignou <gwendal@chromium.org>
Cc: fstests@vger.kernel.org
Subject: Re: [PATCH 2/3] ext4: 032: fail nicely if the test partition is not big enough for the test
Date: Wed, 28 Nov 2018 11:36:40 +0800	[thread overview]
Message-ID: <20181128033640.GR3889@desktop> (raw)
In-Reply-To: <20181127214308.137410-3-gwendal@chromium.org>

On Tue, Nov 27, 2018 at 01:43:07PM -0800, Gwendal Grignou wrote:
> Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
> ---
>  tests/ext4/032 | 11 ++++++++++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/ext4/032 b/tests/ext4/032
> index 8534ddd6..7d8c6da7 100755
> --- a/tests/ext4/032
> +++ b/tests/ext4/032
> @@ -35,12 +35,21 @@ ext4_online_resize()
>  	local original_size=$1
>  	local final_size=$2
>  	local check_if_supported=${3:-0}
> +	local avail=`df -P $SCRATCH_DIR | awk 'END {print $4}'`
> +	local requested=$(($final_size * $BLK_SIZ))
> +
> +	if [ $avail -lt $requested ]; then
> +		echo "+++ not enough space on $SCRATCH_DIR: " \
> +		     "requested $requested only $avail left" | \
> +			tee -a $seqres.full
> +		_notrun "incomplete test due to storage space constraint"
> +	fi

This doesn't look right to me. We can safely truncate to a very large
file size even if the size is bigger than the free space, it's just a
typical sparse file.

I guess the problem is that your SCRATCH_DEV is too small to hold the
post-resize fs image.

Thanks,
Eryu

>  
>  	## Start with a clean image file.
>  	echo "" > ${IMG_FILE}
>  	echo "+++ truncate image file to $final_size" | \
>  		tee -a $seqres.full
> -	$XFS_IO_PROG -f -c "truncate $(($final_size * $BLK_SIZ))" ${IMG_FILE}
> +	$XFS_IO_PROG -f -c "truncate $requested" ${IMG_FILE}
>  	LOOP_DEVICE=`_create_loop_device $IMG_FILE`
>  
>  	echo "+++ create fs on image file $original_size" | \
> -- 
> 2.18.1
> 

  reply	other threads:[~2018-11-28 14:36 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-27 21:43 [PATCH 0/3] Adapt some tests to ChromeOS Gwendal Grignou
2018-11-27 21:43 ` [PATCH 1/3] generic: workaround device where glibc is not installed Gwendal Grignou
2018-11-28  3:30   ` Eryu Guan
2018-11-29  2:10     ` Dave Chinner
2018-11-30  6:37       ` Eryu Guan
2018-11-27 21:43 ` [PATCH 2/3] ext4: 032: fail nicely if the test partition is not big enough for the test Gwendal Grignou
2018-11-28  3:36   ` Eryu Guan [this message]
2018-11-27 21:43 ` [PATCH 3/3] generic: exclude selinux xattr form being considered Gwendal Grignou
2018-11-28  4:37   ` Eryu Guan

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=20181128033640.GR3889@desktop \
    --to=guaneryu@gmail.com \
    --cc=fstests@vger.kernel.org \
    --cc=gwendal@chromium.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.