All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Qu Wenruo <quwenruo@cn.fujitsu.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] btrfs-progs: util: Fix a wrong unit of pretty_size
Date: Wed, 9 Mar 2016 14:03:44 +0100	[thread overview]
Message-ID: <20160309130344.GC738@twin.jikos.cz> (raw)
In-Reply-To: <1457489455-9685-1-git-send-email-quwenruo@cn.fujitsu.com>

On Wed, Mar 09, 2016 at 10:10:55AM +0800, Qu Wenruo wrote:
> If parameter for pretty_size is smaller than default base(1024),
> pretty_size() will output wrong unit.
> For example, pretty_size(1008) will output '0.98B' not '1008B' or
> '0.98KiB'.
> 
> The cause is, for default base and auto-detect unit, base will be 1024
> but num_divs is still 0, last result will still be divided by base,
> causing the bug.
> 
> Fix it by checking num_divs in default case, and if num_divs is 0,
> change base to 1.
> 
> Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>

Applied, thanks.

      reply	other threads:[~2016-03-09 13:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-09  2:10 [PATCH] btrfs-progs: util: Fix a wrong unit of pretty_size Qu Wenruo
2016-03-09 13:03 ` David Sterba [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=20160309130344.GC738@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=quwenruo@cn.fujitsu.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.