This patch adds support to non-USB devices when reset is disabled
with parameter --reset-type=2
This patch address the following issue:
https://github.com/AltraMayor/f3/issues/62
This patch combines many calls to system call write() into
a single call.
This lower number of calls, and the combined buffer should enable
the kernel to speed up f3write to match H2testw' performance as
reported in the following issue:
https://github.com/AltraMayor/f3/issues/55
When f3read is called without parameters --start-at and --end-at,
and a F3 file is missing, f3read shows the following warning:
WARNING: Not all F3 files in the range 1 to 9223372036854775807 are available
This message surprises users, see issue below:
https://github.com/AltraMayor/f3/issues/53
This patch adopts the number of the last file available to compose
the message, so in the example of the issue above, it would be 1741.
Although unexpected, some fake cards do recover blocks after a reset!
This behavior is not consistent, though.
The first reported case is found here:
https://github.com/AltraMayor/f3/issues/50
The code of the applications f3probe, f3brew, and f3fix is now
mature, and they have not received any significant bug report for
about six months.
From now on, one needs to compile these applications with
```make extra```
Replace parse_args() with argp_parse() from argp.h
it also adda option "--show-progress" to force program displaying the progress even when STDOUT is not a TTY (see #21).
When using -O2, GCC was issuing the following warning:
cc -O2 -std=c99 -Wall -Wextra -pedantic -MMD -ggdb -c -o f3probe.o f3probe.c
f3probe.c: In function ‘main’:
f3probe.c:446:13: warning: ‘sdev’ may be used uninitialized in this function [-Wmaybe-uninitialized]
sdev_flush(sdev);
^
f3probe.c:369:30: note: ‘sdev’ was declared here
struct device *dev, *pdev, *sdev;
^
NOTE: The warning was wrong.
GCC could not follow that @args->save being true implied
@sdev to not be NULL.
This patch addresses one of the issues discussed here:
https://github.com/AltraMayor/f3/issues/34
When using -O2, GCC was issuing the following warning:
cc -O2 -std=c99 -Wall -Wextra -pedantic -MMD -ggdb -c -o f3read.o f3read.c
f3read.c: In function ‘validate_file’:
f3read.c:95:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
offset = *((uint64_t *) sector);
^
This patch makes f3probe issue single calls of
sequential reads and writes wherever is possible to speed up
the non-destructive (i.e. conservative) mode.
Notice that the non-destructive mode only recovers the usable
blocks of fake drives, and all blocks of legit drives.
Although I (Michel) am not 100% sure, the kernel seemed to be
allowing reads to get data from an internal cache in the kernel;
the condition is tricky to reproduce, and trickier to be sure
since fake drives are not reliable or preditable.
The results seems more stable with this patch, though.