All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@sandeen.net>
To: Jan Kara <jack@suse.cz>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH] xfstests: Count journal size in test 289
Date: Wed, 20 Mar 2013 09:24:23 -0500	[thread overview]
Message-ID: <5149C697.6060308@sandeen.net> (raw)
In-Reply-To: <20130320104744.GA13294@quack.suse.cz>

On 3/20/13 5:47 AM, Jan Kara wrote:
> On Tue 19-03-13 12:05:18, Eric Sandeen wrote:
>> On 3/19/13 11:21 AM, Jan Kara wrote:
>>> Test 289 ignored the fact that historically journal is not accounted as
>>> fs overhead. For larger filesystems it is hidden in 1% tolerance but for
>>> filesystems smaller than 12G the test fails. So make the counting
>>> precise to work everywhere.
>>
>> Thanks.
>>
>> 0875a2b448fcaba67010850cf9649293a5ef653d ext4: include journal blocks in df overhead calcs
>   Bah, I missed that. But ext3 definitely needs this (and I'm not sure we
> want to change that behavior after so many years - it's mostly cosmetic
> anyway so the possibility of breaking some userspace seems a bad tradeoff).

Sure, that's fine.  Ext4 has munged df reporting a few times recently
anyway, so figured it was worth sneaking in something to make it more
accurate.

>> changed this again, right - so will this change work in both cases?
>   No, it will now fail for small ext4 filesystems instead of small ext3
> filesystems :).  So we will count journal blocks only for ext3, ok?

Sounds like a plan.

>> Also: is using "Journal length: " any simpler?
>   It would be, but older versions of dumpe2fs don't have that (it happened
> somewhere between 1.41.9 and 1.41.11) so I figured I will use a more
> generic approach (too lazy to fix my test machine ;).

Makes sense :)

Thanks,
-Eric

> 								Honza
> 
>>> Signed-off-by: Jan Kara <jack@suse.cz>
>>> ---
>>>  289           |   12 ++++++++----
>>>  common.filter |   15 +++++++++++++++
>>>  2 files changed, 23 insertions(+), 4 deletions(-)
>>>
>>> diff --git a/289 b/289
>>> index b057c20..9bba144 100755
>>> --- a/289
>>> +++ b/289
>>> @@ -59,10 +59,14 @@ TOTAL_BLOCKS=`dumpe2fs -h $SCRATCH_DEV 2>/dev/null \
>>>  FREE_BLOCKS=`dumpe2fs -h $SCRATCH_DEV 2>/dev/null \
>>>  		| awk '/Free blocks:/{print $3}'`
>>>  
>>> -# nb: kernels today don't count journal blocks  as overhead, but should.
>>> -# For most filesystems this will still be within tolerance.
>>> -# Overhead is all the blocks (already) used by the fs itself:
>>> -OVERHEAD=$(($TOTAL_BLOCKS-$FREE_BLOCKS))
>>> +JOURNAL_SIZE=`dumpe2fs -h $SCRATCH_DEV 2>/dev/null \
>>> +		| awk '/Journal size:/{print $3}' | _filter_size_to_bytes`
>>> +BLOCK_SIZE=`dumpe2fs -h $SCRATCH_DEV 2>/dev/null \
>>> +		| awk '/Block size:/{print $3}'`
>>> +JOURNAL_BLOCKS=$(($JOURNAL_SIZE/$BLOCK_SIZE))
>>> +
>>> +# kernels today don't count journal blocks as overhead, but should.
>>> +OVERHEAD=$(($TOTAL_BLOCKS-$FREE_BLOCKS-$JOURNAL_BLOCKS))
>>>  
>>>  #  bsddf|minixdf
>>>  #         Set the behaviour  for  the  statfs  system  call.  The  minixdf
>>> diff --git a/common.filter b/common.filter
>>> index f0f6076..fcd7589 100644
>>> --- a/common.filter
>>> +++ b/common.filter
>>> @@ -229,5 +229,20 @@ _filter_spaces()
>>>         sed -e 's/ [ ]*/ /g'
>>>  }
>>>  
>>> +# Convert string read from stdin like 128K to bytes and print it to stdout
>>> +_filter_size_to_bytes()
>>> +{
>>> +	read size
>>> +	suffix=${size:${#size}-1}
>>> +	mul=1
>>> +	case $suffix in
>>> +		K) mul=1024 ;;
>>> +		M) mul=$((1024*1024)) ;;
>>> +		G) mul=$((1024*1024*1024)) ;;
>>> +		T) mul=$((1024*1024*1024*1024)) ;;
>>> +	esac
>>> +	echo $((${size:0:${#size}-1}*$mul))
>>> +}
>>> +
>>>  # make sure this script returns success
>>>  /bin/true
>>>
>>

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

      reply	other threads:[~2013-03-20 14:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-19 16:21 [PATCH] xfstests: Count journal size in test 289 Jan Kara
2013-03-19 17:05 ` Eric Sandeen
2013-03-20 10:47   ` Jan Kara
2013-03-20 14:24     ` Eric Sandeen [this message]

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=5149C697.6060308@sandeen.net \
    --to=sandeen@sandeen.net \
    --cc=jack@suse.cz \
    --cc=xfs@oss.sgi.com \
    /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.