F3 users have identified fake flashes that reserve a portion of
their good memory to use as a permanent cache.
This patch adds this feature to our model in order to allow us to
develop a new probe algorithm to deal with it.
f3brew were working at sector level because
it was borrowing code from f3write/f3read which work at that level.
This patch writes new functions to fill out, and validate blocks.
This change is important because
f3probe needs to validate blocks as well for its coming features.
A side effect of this patch is that all experimental applications
(i.e. f3probe, f3brew, and f3fix) no longer depend on
code from f3write and f3read.
When a non-root user called f3brew on a device,
f3brew would issue the following error message:
Your username doesn't have access to device `/dev/sdc'.
Try to run this program as root:
sudo f3probe /dev/sdc
In case you don't have access to root, use f3write/f3read.
f3brew: f3brew.c:484: main: Assertion `dev' failed.
Aborted (core dumped)
This patch avoids the assert().
f3probe was using a kernel-recommended logical block size.
This patch allows f3probe to always find
the last good physical block of devices.
This patch also renames option --block-order to --debug-block-order
since f3probe detects the physical block size of devices.
The new parameter allows users to test drives with
forced block sizes.
This parameter is only meant to help testing drives whose
*real* sizes are not multiples of their block sizes;
this should be rather rare!
f3brew, f3 block read write, tests block devices
writing and reading blocks directly to devices.
This is a not-functional version of f3brew.
The main contribution of this patch is to reorganize libprobe.{h,c},
so f3brew, and any future application, can reuse the library.