28 Commits

Author SHA1 Message Date
Michel Machado
7c5d6b7894 f3read/f3write: avoid the execution stack to list files
For large number of files, the original, recursive version of
__ls_my_files() triggers a stack overflow; see issue #153 for
an example.

This patch replaces __ls_my_files() with a version that replaces
the recursion with two scans of the target folder.
2020-12-10 19:38:18 -05:00
Michel Machado
9a9e74250d libflow: accommodate Macs
As of today, macOS or OS X still does not implement
clock_nanosleep() according to this project:
https://github.com/ChisholmKyle/PosixMachTiming
2020-06-23 08:01:52 -04:00
Michel Machado
abf811f04b General review of @zwpwjwtz's patch 2016-03-29 12:35:22 -04:00
zwpwjwtz
fb187b4c71 Replace parse_args() with argp_parse() from argp.h 2016-03-29 15:37:13 +08:00
Michel Machado
0121daf4af Edit a comment 2015-09-02 10:43:36 -04:00
Michel Machado
1db68aa268 Fix yet another building error on Macs
The error was inserted on the following commit:
e8509a05e970bf770db838bd00490f413bb1f432

Sebastian Busch was the first to report this error here:

https://github.com/AltraMayor/f3/issues/6#issuecomment-67152791
2014-12-16 07:35:32 -05:00
Michel Machado
f8050f4721 Address unused-parameter warning on Macs
Function posix_fadvise(), only implemented on Macs, was issuing
warnings because the code doesn't use parameters 'offset' and 'len'.
2014-12-16 07:10:02 -05:00
Michel Machado
e8509a05e9 Another take on fixing building issue on Macs
This patch is based on artosx's feedback on GitHub:

https://github.com/AltraMayor/f3/issues/6#issuecomment-67075953
2014-12-16 07:05:48 -05:00
Michel Machado
99dab5ca08 Make all applications share the same version 2014-09-21 11:47:19 -04:00
Michel Machado
55d201792c Bump next version to 4.0
Given that support for FreeBSD was added,
the next release will no longer be 3.1, but 4.0.
2014-09-09 10:12:40 -04:00
Michel Machado
1792cf1509 Prepare code for release of version 3.1 2014-08-15 17:30:38 -04:00
Michel Machado
d742672fa1 Add optional parameter --end-at=NUM to F3
This parameter allows users to execute F3 concurrently.

Moreover, users Mark and Wolfi have asked for similar parameters to
help analyzing very large flash drives.
2014-08-15 17:30:38 -04:00
Michel Machado
c98e580b94 General code review
- Comply with C99 standard.
- Adopt compiling flag -Wextra.
- Adopt compiling flag -Wpedantic.
- Drop use of PATH_MAX constant.
2014-08-12 13:56:01 -04:00
Michel Machado
7bd73cc434 Increment version to 3.0 2014-05-14 13:16:43 -04:00
Michel Machado
be1f587142 Adopt h2testw's file format
Now F3 and h2testw share the same file format.
Guenter Knauf has suggested this feature and
got the random-number generator used in h2testw from
Harald Bogeholz, the author of h2testw.

This change also addresses the issue that
the original random-number generator only fills
the first 32 bits of the 64 bits of the random numbers on
64-bit machines.
Besides the lower entropy on 64-bit machines, this issue was
making files generated on 32-bit and 64-bit machines incompatible.
Anselm Distelrath was the first to report this issue.
2014-05-14 11:44:13 -04:00
Michel Machado
a41f4a0c08 Add support for Windows/Cygwin
This commit is based on Tom Hall's patch.
2014-05-14 09:44:36 -04:00
Michel Machado
532bad04d6 Increment version to 2.2 2013-02-08 15:14:28 -05:00
Michel Machado
f2a27db58c Add option parameter --start-at=NUM to F3
This parameter became important because F3 now can be used on
very large storages and one may want to resume the test process
from a failure or interruption.
2013-02-08 15:14:28 -05:00
Michel Machado
90b0bfbfcd Remove arbitrary limit on filenames
The filenames were from 0001.fff to 9999.fff.
This limit hasn't been a problem, but Anselm Distelrath reported
on February 8th, 2013 that isn't enough to test his system:
a RAID 6 with 18 hard drives of 3TB each.

Now filenames are from 1.fff to <INT_MAX>.fff.
2013-02-08 15:13:29 -05:00
Michel Machado
a642c2f3c8 Fix bug first reported by Martin Theiss
f3read finishes with following error message:

f3read: utils.c:39: number_from_filename: Assertion `is_my_file(filename)' failed.
2012-09-30 17:38:49 -04:00
Michel Machado
891e739b94 Minor code refinements
These refinements doesn't add or change a feature.
2012-09-28 10:54:05 -04:00
Michel Machado
c24c098c3c Report version and copyright in help message
This was added mainly to help users to identify
the version they have installed.
2012-03-07 11:29:40 -05:00
Michel Machado
f7d57f76e0 Made f3write remove old F3 files in order
Messages like "Removing old file 0001.fff ..." were issued in
a file system dependent order.

This is a cosmetic change that takes advantage of
the function ls_my_files previously created for f3read.
2011-12-26 17:26:08 -02:00
Michel Machado
d350745fc2 Verify that "all" F3 files are present
If an F3 file (i.e. *.fff) but the last one is missing,
f3read will report the missing file with a warning similar to this one:

Missing file 0001.fff

AND the following warning will be presented at the end of the report:

WARNING: Not all F3 files are available

Kenneth Arnold suggested this feature in an e-mail:
"I also noticed that if one of the files is completely missing, f3read
will still report no errors. The chance that this will happen on its
own without messing something else up is too small to worry about,
except possibly in the case that the device was actually read-only and
no files actually got created. In that case, f3read succeeds with 0
sectors OK and 0 sectors lost."

The last F3 file, if missing, is not reported because
it can be confusing.
The following example gives an idea of the problem:
a memory card wasn't empty when f3write was called and
the last F3 file created was 0010.fff with exactly 1GB;
here none F3 file is missing.
Then, some non-F3 files were removed, and f3read is called.
f3read would report a missing file even when non-F3 files were
removed!
The problem gets a little bit uglier if 0010.fff in the example
is less that 1GB, or the file system doesn't let f3write to
fill it up for a few bytes (this should be very rare, but
there's no guarantee that it cannot happen).

Finally, the implementation of this feature has a positive
side effect: f3read processes F3 files in ascending order,
that is, 0001.fff, 0002.fff, ..., NNNN.fff.
Before the order was file system dependent.

Magic numbers related to the number of digits in the F3 files'
names were eliminated.
2011-12-23 22:16:19 -02:00
Michel Machado
cbadb0c91c Reviewed code 2011-12-20 14:02:17 -05:00
Michel Machado
0510a6c08d Added support for Macs 2011-12-20 11:21:42 -05:00
Michel Machado
d2a1a289fd Formated code following Linux's coding style
See file Documentation/CodingStyle in Linux's source code
for a reference of the style.

Used "indent -kr -i8" to help out.

Added a .gitignore to the repository.
2011-12-14 19:09:20 -05:00
Michel Machado
8bd4f358da Copied code from GNU Library C to improve portability
This version should compile and run on Apples, but since
I don't have one, I haven't tested it.
2011-12-14 15:48:15 -05:00