f3probe writes multiple MiB of data
- 主要语言
- C
- 星标
- 3.4k
- 派生
- 177
- 平均合并
- 2 天 15 小时
- 30 天内合并 PR
- 2
描述
Adding diagnostic output to `write_blocks()` and also simply looking at an I/O monitor, there clearly is a lot of data being written to the flash disk while running `f3probe`. The readme says it is the "fastest" and "only writes what's necessary". I'd think the following procedure would suffice. What would be wrong with this approach, assuming like `f3probe` that fake flash simply discards one or more top address bits?
1. Write 1 block with unique contents to the last block of the fake disk, i.e. at position `fake_size_in_blocks - 1`. Assign this position to `a`.
2. Since we assume that fake flash has at least 1 block of real storage we do not need to test that the block can be read back at position `a`. It will, unless there is some other damage and we are not interested in testing for this here.
3. Set `n = log_2(floor(a))`.
4. Read at position `a - 2^n`, i.e. clearing the top non-zero address bit.
5. If our special block comes back record that address bit `n` is not connected.
6. If `a` is not `2^(n+1) - 1`, write our unique contents also to position `2^n - 1`.
7. Set `a = 2^n - 1`, i.e. the last block of the next smaller power of 2 fake drive size.
8. Go to step 3 if `a` is not 0 (or above some other reasonable threshold, e.g. 2048 if assuming there is at least 1 MiB of real storage)
9. Report fake flash if at least 1 bit is not connected
10. Report useable size as `block_size * 2^m` where `m` is the lowest address bit not connected
贡献指南
这个仓库没有索引到贡献指南
评估
这个 Issue 还没有评估数据。