public inbox for util-linux@vger.kernel.org
 help / color / mirror / Atom feed
From: "Pádraig Brady" <P@draigBrady.com>
To: Karel Zak <kzak@redhat.com>
Cc: Bernhard Voelker <mail@bernhard-voelker.de>,
	"util-linux@vger.kernel.org" <util-linux@vger.kernel.org>
Subject: Re: fallocate: --punch option parsing error diagnostics irritating
Date: Thu, 26 Jun 2014 11:52:10 +0100	[thread overview]
Message-ID: <53ABFB5A.9020005@draigBrady.com> (raw)
In-Reply-To: <20140626101009.GD30418@x2.net.home>

On 06/26/2014 11:10 AM, Karel Zak wrote:
> On Wed, Jun 25, 2014 at 10:16:54PM +0200, Bernhard Voelker wrote:
>>   $ ./fallocate -p -l 10000 /tmp/x
>>   fallocate: only -n mode can be used with --zero-range
>>
>> Huh? I didn't specify neither -n nor -z.
> 
> 		case 'p':
> 			mode |= FALLOC_FL_PUNCH_HOLE;
> 			/* fall through */
> 		case 'n':
> 			mode |= FALLOC_FL_KEEP_SIZE;
> 			break;
> 
> 
> unfortunately there is nothing about it in man page and usage(). It's
> described in fallocate(2) syscall man page only.
> 
> Anyway, the code is wrong, it assumes that KEEP_SIZE is possible to use
> only with ZERO_RANGE. 
> 
> Fixed in git tree, man page massively modified to be readable for
> humans (original text in the man page was from FS devels:-)
> 
>> Finally, please add some examples to the man page.
> 
> I think the new version of the man page is good enough without examples, but 
> if someone has something nice we can add EXAMPLES section.

--help could he clarified:

diff --git a/sys-utils/fallocate.c b/sys-utils/fallocate.c
index d950f9c..6192f0a 100644
--- a/sys-utils/fallocate.c
+++ b/sys-utils/fallocate.c
@@ -75,13 +75,13 @@ static void __attribute__((__noreturn__)) usage(FILE *out)
        fprintf(out,
              _(" %s [options] <filename>\n"), program_invocation_short_name);
        fputs(USAGE_OPTIONS, out);
-       fputs(_(" -c, --collapse-range collapse space in the file\n"), out);
-       fputs(_(" -d, --dig-holes      detect and dig holes\n"), out);
-       fputs(_(" -l, --length <num>   length of the (de)allocation, in bytes\n"), out);
-       fputs(_(" -n, --keep-size      don't modify the length of the file\n"), out);
-       fputs(_(" -o, --offset <num>   offset of the (de)allocation, in bytes\n"), out);
-       fputs(_(" -p, --punch-hole     punch holes in the file (implies --keep-size)\n"), out);
-       fputs(_(" -z, --zero-range     zeroes a range in the file\n"), out);
+       fputs(_(" -c, --collapse-range remove a range from the file\n"), out);
+       fputs(_(" -d, --dig-holes      detect zeroes and replace with holes\n"), out);
+       fputs(_(" -l, --length <num>   length for range operations, in bytes\n"), out);
+       fputs(_(" -n, --keep-size      maintain the apparent size of the file\n"), out);
+       fputs(_(" -o, --offset <num>   offset for range operations, in bytes\n"), out);
+       fputs(_(" -p, --punch-hole     replace a range with a hole (implies -n)\n"), out);
+       fputs(_(" -z, --zero-range     zero and ensure allocation of a range\n"), out);
        fputs(_(" -v, --verbose        verbose mode\n"), out);

        fputs(USAGE_SEPARATOR, out);


  reply	other threads:[~2014-06-26 10:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-25 20:16 fallocate: --punch option parsing error diagnostics irritating Bernhard Voelker
2014-06-25 20:35 ` Dale R. Worley
2014-06-26 10:10 ` Karel Zak
2014-06-26 10:52   ` Pádraig Brady [this message]
2014-06-26 11:07     ` Karel Zak
2014-06-26 12:14       ` Bernhard Voelker
2014-06-26 12:49         ` Karel Zak

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=53ABFB5A.9020005@draigBrady.com \
    --to=p@draigbrady.com \
    --cc=kzak@redhat.com \
    --cc=mail@bernhard-voelker.de \
    --cc=util-linux@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox