mirror of
https://github.com/AltraMayor/f3.git
synced 2025-08-03 10:35:57 -04:00
f3probe: drop `Last good sector:' from geometry
The field `Last good sector:' does not make sense when the device is damaged, and the geometry should be indepedent of the condition or type of the drive. The information is not lost because when the device "fixable", f3fix is recommended with the correct parameter.
This commit is contained in:
parent
b70b9ce914
commit
172f19373a
14
f3probe.c
14
f3probe.c
@ -337,11 +337,6 @@ static void report_order(const char *prefix, int order)
|
||||
printf("%s %.2f %s (2^%i Bytes)\n", prefix, f, unit, order);
|
||||
}
|
||||
|
||||
static void report_sector(const char *prefix, uint64_t sector)
|
||||
{
|
||||
printf("%s %" PRIu64 "\n", prefix, sector);
|
||||
}
|
||||
|
||||
static void report_ops(const char *op, uint64_t count, uint64_t time_us)
|
||||
{
|
||||
printf("Probe %s op: count=%" PRIu64
|
||||
@ -361,7 +356,6 @@ static int test_device(struct args *args)
|
||||
uint64_t write_count, write_time_us;
|
||||
uint64_t reset_count, reset_time_us;
|
||||
const char *final_dev_filename;
|
||||
uint64_t last_good_sector;
|
||||
|
||||
dev = args->debug
|
||||
? create_file_device(args->filename, args->real_size_byte,
|
||||
@ -436,7 +430,6 @@ static int test_device(struct args *args)
|
||||
printf("\nWARNING: device `%s' moved to `%s' due to the resets\n\n",
|
||||
args->filename, final_dev_filename);
|
||||
|
||||
last_good_sector = (real_size_byte >> 9) - 1;
|
||||
fake_type = dev_param_to_type(real_size_byte, announced_size_byte,
|
||||
wrap, block_order);
|
||||
switch (fake_type) {
|
||||
@ -452,13 +445,16 @@ static int test_device(struct args *args)
|
||||
|
||||
case FKTY_LIMBO:
|
||||
case FKTY_WRAPAROUND:
|
||||
case FKTY_CHAIN:
|
||||
case FKTY_CHAIN: {
|
||||
uint64_t last_good_sector = (real_size_byte >> 9) - 1;
|
||||
assert(block_order >= 9);
|
||||
printf("Bad news: The device `%s' is a counterfeit of type %s\n\n"
|
||||
"You can \"fix\" this device using the following command:\n"
|
||||
"f3fix --last-sec=%" PRIu64 " %s\n",
|
||||
final_dev_filename, fake_type_to_name(fake_type),
|
||||
last_good_sector, final_dev_filename);
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
assert(0);
|
||||
@ -471,8 +467,6 @@ static int test_device(struct args *args)
|
||||
report_size("\t Announced size:", announced_size_byte, block_order);
|
||||
report_order("\t Module:", wrap);
|
||||
report_order("\t Block size:", block_order);
|
||||
assert(block_order >= 9);
|
||||
report_sector("\tLast good sector:", last_good_sector);
|
||||
printf("\nProbe time: %.2f seconds\n", time_s);
|
||||
|
||||
if (args->time_ops) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user