xfs
[Top] [All Lists]

Re: [PATCH] xfstests: generic/315: add one more sync and more output

To: Josef Bacik <jbacik@xxxxxxxxxxxx>
Subject: Re: [PATCH] xfstests: generic/315: add one more sync and more output
From: Eric Sandeen <sandeen@xxxxxxxxxx>
Date: Mon, 29 Jul 2013 12:31:06 -0500
Cc: linux-btrfs@xxxxxxxxxxxxxxx, xfs@xxxxxxxxxxx, jeff.liu@xxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <1375118463-29654-1-git-send-email-jbacik@xxxxxxxxxxxx>
References: <1375118463-29654-1-git-send-email-jbacik@xxxxxxxxxxxx>
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130620 Thunderbird/17.0.7
On 7/29/13 12:21 PM, Josef Bacik wrote:
> So df in btrfs is tricky at best, and relying on it for accurate information 
> is
> not great, but it's the best way to verify this test.  So we need to add 
> another
> sync to make sure the pinned blocks are all freed up and the df space is 
> really
> really accurate, otherwise we end up with this test failling because the df
> after the test is slightly off (in my case it was like 36kb off).  With this
> patch I'm not seeing random failures of this test.  Thanks,

Honest question: does one more sync make this deterministic, or is it a 
best-effort, um, hack?

-Eric

> Signed-off-by: Josef Bacik <jbacik@xxxxxxxxxxxx>
> ---
>  tests/generic/315 |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/tests/generic/315 b/tests/generic/315
> index 7cfc40d..7c55b8a 100644
> --- a/tests/generic/315
> +++ b/tests/generic/315
> @@ -70,10 +70,11 @@ fsize=`ls -l $TEST_DIR/testfile.$seq | awk '{print $5}'`
>  # Truncate the file size back to 0
>  truncate -s 0 $TEST_DIR/testfile.$seq
>  sync
> +sync
>  
>  # Preallocated disk space should be released
>  avail_done=`df -P $TEST_DIR | awk 'END {print $4}'`
> -[ "$avail_done" -eq "$avail_begin" ] || _fail "Available disk space 
> ($avail_done KiB)"
> +[ "$avail_done" -eq "$avail_begin" ] || _fail "Available disk space 
> ($avail_done KiB) wanted ($avail_begin KiB)"
>  
>  # success, all done
>  exit
> 

<Prev in Thread] Current Thread [Next in Thread>