linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Goffredo Baroncelli <kreijack@gmail.com>
To: Goffredo Baroncelli <kreijack@inwind.it>
Cc: Goffredo Baroncelli <kreijack@gmail.com>,
	linux-btrfs@vger.kernel.org,
	Stefan Behrens <sbehrens@giantdisaster.de>
Subject: Re: [PATCH] Btrfs-progs: use atoll() for mkfs.btrfs size option
Date: Mon, 15 Oct 2012 21:15:22 +0200	[thread overview]
Message-ID: <1350328523-7465-1-git-send-email-kreijack@gmail.com> (raw)
In-Reply-To: <1350299942-23468-1-git-send-email-sbehrens@giantdisaster.de>

Hi Stefan,

when I checked your patch I found further problems to the function
parse_size():
- this function is declared two time: both in mkfs.c and in cmd-filesystem.c;
this is a good chance to move it in the utils.c file.
- your suggestion was to use atoll, which is signed. strtoull (which is
unsigned) would be a better choice.
- this function doesn't check for overflow [minor]
- if a number like 123MB is passed, it is evaluated as 123 instead of
123*1024*1024 [bug]

This suggested me to make the following patch.
Hoping to not offende anybody :-)

BR
G.Baroncelli

Signed-off-by: Goffredo Baroncelli <kreijack@inwind.it>

You can pull the patch from 
   http://cassiopea.homelinux.net/git/btrfs-progs-unstable.git
branch
   parse_size



  reply	other threads:[~2012-10-15 19:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-15 11:19 [PATCH] Btrfs-progs: use atoll() for mkfs.btrfs size option Stefan Behrens
2012-10-15 19:15 ` Goffredo Baroncelli [this message]
2012-10-15 19:15   ` [PATCH] Move parse_size() in utils.c Goffredo Baroncelli
2012-10-15 20:36     ` Stefan Behrens
2012-10-15 21:07       ` Goffredo Baroncelli

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=1350328523-7465-1-git-send-email-kreijack@gmail.com \
    --to=kreijack@gmail.com \
    --cc=kreijack@inwind.it \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=sbehrens@giantdisaster.de \
    /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).