Re: [PATCH V3] punch-alternating: add some options

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]



On 5/4/17 11:32 PM, Eryu Guan wrote:
> On Thu, May 04, 2017 at 01:25:05PM -0500, Eric Sandeen wrote:

...

>> -	if (argc != 2) {
>> -		printf("Usage: %s file\n", argv[0]);
>> -		printf("Punches every other block in the file.\n");
>> -		return 1;
>> +	if (size < 0) {
>> +		printf("size must be >= 0\n");
>> +		usage(argv[0]);
> 
> Can size be 0? Seems not, otherwise we call fallocate with zero length.
> I got this error if I use "-s 0"
> 
> $ ./src/punch-alternating -s 0 -i 8 testfile
> -s: Invalid argument
> 
> And the "-s" part indicates that the perror call in 'err' label should
> be updated too, i.e. argv[1] => argv[optind]
> 
> They're simple enough to be fixed at commit time, if you think they're
> sane fixes :)

Sigh, yes please.  I'm apparently now unable to write or test the simplest
code.  :/

-Eric
--
To unsubscribe from this list: send the line "unsubscribe fstests" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Filesystems Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux