Added check_progs for immediate prog validation
This configuration option enables the previous behavior of reading back every prog to check that the data was written correctly. Unfortunately, this brings a bit of baggage, thanks to our cache interactions being more complicated now: - We really want to reuse the rcache for prog validation, despite the cache performance implications. Unfortunately, we simply can't, thanks to the new bd utility functions tying up the rcache. lfsr_bd_cpy, for example, does not expect rcache to be invalidated between a read and prog, and if it is, things break (I may or may not have found this by experience). These bd utilities are valuable, so we really need some other way to validate our progs. - Since we can't rely on the rcache, this leaves checksumming as the only option for validating progs. Checksumming isn't perfect, as there is a decent chance of false negatives, but to be honest it's probably good enough for anything that's not malicious. - This also adds the new constraint that we need to be able to read back any prog into the pcache, which implies read_size <= prog_size. This constraint didn't exist when we could clobber our rcache, but this is not worth throwing away the new bd utilities. Not to mention clobbering our rcache could hurt cache performance. Why not make read_size <= prog_size conditional on check_progs? The main reason is convenience. One very compelling use case for check_progs is to help debug unknown filesystem/integration failures, buf if you can't enable check_progs without changing the filesystem configuration, you can't really rely on check_progs for debugging. This helps future proof what we expect from block devices, in case future error detection/correction mechanisms can benefit from our prog_size always being readable. Code changes were not that significant, however there was a surprising stack cost. This seems to be because lfsr_bd_read__ can now be called from multiple places, causing it to no longer be inlined in lfsr_bd_read_, costing a bit of stack for the additional function call: before: 33566 2624 after: 33682 (+0.3%) 2640 (+0.6%)
This commit is contained in:
@@ -148,6 +148,40 @@ static int lfsr_bd_prog_(lfs_t *lfs, lfs_block_t block, lfs_size_t off,
|
||||
return err;
|
||||
}
|
||||
|
||||
// check progs?
|
||||
if (lfs->cfg->check_progs) {
|
||||
// we want to reuse our buffer, so use a checksum to compare
|
||||
uint32_t pcksum = lfs_crc32c(0, buffer, size);
|
||||
|
||||
// pcache should have been dropped at this point
|
||||
LFS_ASSERT(lfs->pcache.size == 0);
|
||||
|
||||
// read back our prog
|
||||
uint32_t pcksum_ = 0;
|
||||
lfs_size_t off_ = off;
|
||||
while (off_ < off + size) {
|
||||
lfs_size_t size_ = lfs_min(
|
||||
size - (off_-off),
|
||||
lfs->cfg->pcache_size);
|
||||
err = lfsr_bd_read__(lfs, block, off_,
|
||||
lfs->pcache.buffer, size_);
|
||||
if (err) {
|
||||
return err;
|
||||
}
|
||||
|
||||
pcksum_ = lfs_crc32c(pcksum_, lfs->pcache.buffer, size_);
|
||||
off_ += size_;
|
||||
}
|
||||
|
||||
if (pcksum != pcksum_) {
|
||||
LFS_DEBUG("Bad prog 0x%"PRIx32".%"PRIx32" %"PRIu32" "
|
||||
"(%08"PRIx32" != %08"PRIx32")",
|
||||
block, off, size,
|
||||
pcksum, pcksum_);
|
||||
return LFS_ERR_CORRUPT;
|
||||
}
|
||||
}
|
||||
|
||||
// update rcache if we overlap
|
||||
if (block == lfs->rcache.block
|
||||
&& off < lfs->rcache.off + lfs->rcache.size
|
||||
@@ -306,19 +340,17 @@ static int lfsr_bd_flush(lfs_t *lfs, uint32_t *cksum_) {
|
||||
0xff,
|
||||
aligned_size - lfs->pcache.size);
|
||||
|
||||
// make this cache available, if we error anything in this cache
|
||||
// would be useless anyways
|
||||
lfsr_bd_droppcache(lfs);
|
||||
|
||||
// flush
|
||||
int err = lfsr_bd_prog_(lfs, lfs->pcache.block,
|
||||
lfs->pcache.off, lfs->pcache.buffer, aligned_size,
|
||||
cksum_);
|
||||
if (err) {
|
||||
// if an error occurs we really don't want to flush our
|
||||
// cache again
|
||||
lfsr_bd_droppcache(lfs);
|
||||
return err;
|
||||
}
|
||||
|
||||
// make this cache available
|
||||
lfsr_bd_droppcache(lfs);
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -2293,7 +2325,7 @@ static int lfsr_rbyd_fetchvalidate(lfs_t *lfs, lfsr_rbyd_t *rbyd,
|
||||
if (err) {
|
||||
if (err == LFS_ERR_CORRUPT) {
|
||||
LFS_ERROR("Found corrupted rbyd 0x%"PRIx32".%"PRIx32", "
|
||||
"cksum 0x%08"PRIx32,
|
||||
"cksum %08"PRIx32,
|
||||
block, trunk, cksum);
|
||||
}
|
||||
return err;
|
||||
@@ -2306,7 +2338,7 @@ static int lfsr_rbyd_fetchvalidate(lfs_t *lfs, lfsr_rbyd_t *rbyd,
|
||||
// same trunk and pass its internal cksum
|
||||
if (rbyd->cksum != cksum) {
|
||||
LFS_ERROR("Found rbyd cksum mismatch rbyd 0x%"PRIx32".%"PRIx32", "
|
||||
"cksum 0x%08"PRIx32" (!= 0x%08"PRIx32")",
|
||||
"cksum %08"PRIx32" (!= %08"PRIx32")",
|
||||
rbyd->blocks[0], lfsr_rbyd_trunk(rbyd), rbyd->cksum, cksum);
|
||||
return LFS_ERR_CORRUPT;
|
||||
}
|
||||
@@ -15398,10 +15430,12 @@ static int lfs_init(lfs_t *lfs, const struct lfs_config *cfg) {
|
||||
LFS_ASSERT(lfs->cfg->rcache_size != 0);
|
||||
LFS_ASSERT(lfs->cfg->pcache_size != 0);
|
||||
|
||||
// cache sizes must be a multiple of the operation size
|
||||
// cache sizes must be a multiple of their operation sizes
|
||||
LFS_ASSERT(lfs->cfg->rcache_size % lfs->cfg->read_size == 0);
|
||||
LFS_ASSERT(lfs->cfg->pcache_size % lfs->cfg->prog_size == 0);
|
||||
|
||||
// prog_size must be a multiple of read_size
|
||||
LFS_ASSERT(lfs->cfg->prog_size % lfs->cfg->read_size == 0);
|
||||
// block_size must be a multiple of both prog/read size
|
||||
LFS_ASSERT(lfs->cfg->block_size % lfs->cfg->read_size == 0);
|
||||
LFS_ASSERT(lfs->cfg->block_size % lfs->cfg->prog_size == 0);
|
||||
|
||||
@@ -195,7 +195,7 @@ struct lfs_config {
|
||||
lfs_size_t read_size;
|
||||
|
||||
// Minimum size of a program in bytes. All program operations will be a
|
||||
// multiple of this value.
|
||||
// multiple of this value. Must be a multiple of the read size.
|
||||
lfs_size_t prog_size;
|
||||
|
||||
// Size of an erasable block in bytes. This does not impact ram consumption
|
||||
@@ -301,6 +301,11 @@ struct lfs_config {
|
||||
// 0 only writes blocks, minimizing disk usage, while -1 or any value >=
|
||||
// block_size only writes fragments, minimizing random-write cost.
|
||||
lfs_size_t crystal_thresh;
|
||||
|
||||
// TODO should lfs_mount accept flags?
|
||||
|
||||
// Check progs by immediately reading back any progged data
|
||||
bool check_progs;
|
||||
};
|
||||
|
||||
// File info structure
|
||||
|
||||
@@ -124,6 +124,7 @@ void bench_permutation(size_t i, uint32_t *buffer, size_t size);
|
||||
BENCH_DEFINE(SHRUB_SIZE, INLINE_SIZE ) \
|
||||
BENCH_DEFINE(FRAGMENT_SIZE, BLOCK_SIZE/8 ) \
|
||||
BENCH_DEFINE(CRYSTAL_THRESH, BLOCK_SIZE/8 ) \
|
||||
BENCH_DEFINE(CHECK_PROGS, false ) \
|
||||
BENCH_DEFINE(ERASE_VALUE, 0xff ) \
|
||||
BENCH_DEFINE(ERASE_CYCLES, 0 ) \
|
||||
BENCH_DEFINE(BADBLOCK_BEHAVIOR, LFS_EMUBD_BADBLOCK_PROGERROR ) \
|
||||
@@ -150,7 +151,8 @@ void bench_permutation(size_t i, uint32_t *buffer, size_t size);
|
||||
.inline_size = INLINE_SIZE, \
|
||||
.shrub_size = SHRUB_SIZE, \
|
||||
.fragment_size = FRAGMENT_SIZE, \
|
||||
.crystal_thresh = CRYSTAL_THRESH,
|
||||
.crystal_thresh = CRYSTAL_THRESH, \
|
||||
.check_progs = CHECK_PROGS,
|
||||
|
||||
#define BENCH_BDCFG \
|
||||
.erase_value = ERASE_VALUE, \
|
||||
|
||||
@@ -109,6 +109,7 @@ void test_permutation(size_t i, uint32_t *buffer, size_t size);
|
||||
TEST_DEFINE(SHRUB_SIZE, INLINE_SIZE ) \
|
||||
TEST_DEFINE(FRAGMENT_SIZE, BLOCK_SIZE/8 ) \
|
||||
TEST_DEFINE(CRYSTAL_THRESH, BLOCK_SIZE/8 ) \
|
||||
TEST_DEFINE(CHECK_PROGS, false ) \
|
||||
TEST_DEFINE(ERASE_VALUE, 0xff ) \
|
||||
TEST_DEFINE(ERASE_CYCLES, 0 ) \
|
||||
TEST_DEFINE(BADBLOCK_BEHAVIOR, LFS_EMUBD_BADBLOCK_PROGERROR ) \
|
||||
@@ -135,7 +136,8 @@ void test_permutation(size_t i, uint32_t *buffer, size_t size);
|
||||
.inline_size = INLINE_SIZE, \
|
||||
.shrub_size = SHRUB_SIZE, \
|
||||
.fragment_size = FRAGMENT_SIZE, \
|
||||
.crystal_thresh = CRYSTAL_THRESH,
|
||||
.crystal_thresh = CRYSTAL_THRESH, \
|
||||
.check_progs = CHECK_PROGS,
|
||||
|
||||
#define TEST_BDCFG \
|
||||
.erase_value = ERASE_VALUE, \
|
||||
|
||||
+80
-64
@@ -10,11 +10,12 @@ defines.BADBLOCK = -1
|
||||
defines.BADBLOCK_BEHAVIOR = [
|
||||
'LFS_EMUBD_BADBLOCK_PROGERROR',
|
||||
'LFS_EMUBD_BADBLOCK_ERASEERROR',
|
||||
# TODO
|
||||
# 'LFS_EMUBD_BADBLOCK_READERROR',
|
||||
# 'LFS_EMUBD_BADBLOCK_PROGNOOP',
|
||||
# 'LFS_EMUBD_BADBLOCK_ERASENOOP',
|
||||
'LFS_EMUBD_BADBLOCK_READERROR',
|
||||
'LFS_EMUBD_BADBLOCK_PROGNOOP',
|
||||
'LFS_EMUBD_BADBLOCK_ERASENOOP',
|
||||
]
|
||||
# we need prog checking to detect read errors
|
||||
defines.CHECK_PROGS = 'BADBLOCK_BEHAVIOR >= LFS_EMUBD_BADBLOCK_READERROR'
|
||||
defines.N = [1, 2, 4, 8, 16, 32, 64, 128, 256, 512]
|
||||
# maximize lookahead buffer to avoid alloc scans
|
||||
defines.LOOKAHEAD_SIZE = 'lfs_alignup(BLOCK_COUNT / 8, 8)'
|
||||
@@ -116,11 +117,12 @@ defines.ERASE_CYCLES = 0xffffffff
|
||||
defines.BADBLOCK_BEHAVIOR = [
|
||||
'LFS_EMUBD_BADBLOCK_PROGERROR',
|
||||
'LFS_EMUBD_BADBLOCK_ERASEERROR',
|
||||
# TODO
|
||||
# 'LFS_EMUBD_BADBLOCK_READERROR',
|
||||
# 'LFS_EMUBD_BADBLOCK_PROGNOOP',
|
||||
# 'LFS_EMUBD_BADBLOCK_ERASENOOP',
|
||||
'LFS_EMUBD_BADBLOCK_READERROR',
|
||||
'LFS_EMUBD_BADBLOCK_PROGNOOP',
|
||||
'LFS_EMUBD_BADBLOCK_ERASENOOP',
|
||||
]
|
||||
# we need prog checking to detect read errors
|
||||
defines.CHECK_PROGS = 'BADBLOCK_BEHAVIOR >= LFS_EMUBD_BADBLOCK_READERROR'
|
||||
defines.MIRROR = [false, true]
|
||||
defines.N = [1, 2, 4, 8, 16, 32, 64, 128, 256, 512]
|
||||
# maximize lookahead buffer to avoid alloc scans
|
||||
@@ -220,11 +222,12 @@ defines.ERASE_CYCLES = 0xffffffff
|
||||
defines.BADBLOCK_BEHAVIOR = [
|
||||
'LFS_EMUBD_BADBLOCK_PROGERROR',
|
||||
'LFS_EMUBD_BADBLOCK_ERASEERROR',
|
||||
# TODO
|
||||
# 'LFS_EMUBD_BADBLOCK_READERROR',
|
||||
# 'LFS_EMUBD_BADBLOCK_PROGNOOP',
|
||||
# 'LFS_EMUBD_BADBLOCK_ERASENOOP',
|
||||
'LFS_EMUBD_BADBLOCK_READERROR',
|
||||
'LFS_EMUBD_BADBLOCK_PROGNOOP',
|
||||
'LFS_EMUBD_BADBLOCK_ERASENOOP',
|
||||
]
|
||||
# we need prog checking to detect read errors
|
||||
defines.CHECK_PROGS = 'BADBLOCK_BEHAVIOR >= LFS_EMUBD_BADBLOCK_READERROR'
|
||||
defines.MIRROR = [false, true]
|
||||
defines.N = [1, 2, 4, 8, 16, 32, 64, 128, 256, 512]
|
||||
# maximize lookahead buffer to avoid alloc scans
|
||||
@@ -327,11 +330,12 @@ defines.BADBLOCK = -1
|
||||
defines.BADBLOCK_BEHAVIOR = [
|
||||
'LFS_EMUBD_BADBLOCK_PROGERROR',
|
||||
'LFS_EMUBD_BADBLOCK_ERASEERROR',
|
||||
# TODO
|
||||
# 'LFS_EMUBD_BADBLOCK_READERROR',
|
||||
# 'LFS_EMUBD_BADBLOCK_PROGNOOP',
|
||||
# 'LFS_EMUBD_BADBLOCK_ERASENOOP',
|
||||
'LFS_EMUBD_BADBLOCK_READERROR',
|
||||
'LFS_EMUBD_BADBLOCK_PROGNOOP',
|
||||
'LFS_EMUBD_BADBLOCK_ERASENOOP',
|
||||
]
|
||||
# we need prog checking to detect read errors
|
||||
defines.CHECK_PROGS = 'BADBLOCK_BEHAVIOR >= LFS_EMUBD_BADBLOCK_READERROR'
|
||||
defines.N = [1, 2, 4, 8, 16, 32, 64, 128, 256]
|
||||
# do more ops than dirs to encourage rename collisions
|
||||
defines.OPS = '2*N'
|
||||
@@ -457,11 +461,12 @@ defines.ERASE_CYCLES = 0xffffffff
|
||||
defines.BADBLOCK_BEHAVIOR = [
|
||||
'LFS_EMUBD_BADBLOCK_PROGERROR',
|
||||
'LFS_EMUBD_BADBLOCK_ERASEERROR',
|
||||
# TODO
|
||||
# 'LFS_EMUBD_BADBLOCK_READERROR',
|
||||
# 'LFS_EMUBD_BADBLOCK_PROGNOOP',
|
||||
# 'LFS_EMUBD_BADBLOCK_ERASENOOP',
|
||||
'LFS_EMUBD_BADBLOCK_READERROR',
|
||||
'LFS_EMUBD_BADBLOCK_PROGNOOP',
|
||||
'LFS_EMUBD_BADBLOCK_ERASENOOP',
|
||||
]
|
||||
# we need prog checking to detect read errors
|
||||
defines.CHECK_PROGS = 'BADBLOCK_BEHAVIOR >= LFS_EMUBD_BADBLOCK_READERROR'
|
||||
defines.MIRROR = [false, true]
|
||||
defines.N = [1, 2, 4, 8, 16, 32, 64, 128, 256]
|
||||
# do more ops than dirs to encourage rename collisions
|
||||
@@ -589,11 +594,12 @@ defines.ERASE_CYCLES = 0xffffffff
|
||||
defines.BADBLOCK_BEHAVIOR = [
|
||||
'LFS_EMUBD_BADBLOCK_PROGERROR',
|
||||
'LFS_EMUBD_BADBLOCK_ERASEERROR',
|
||||
# TODO
|
||||
# 'LFS_EMUBD_BADBLOCK_READERROR',
|
||||
# 'LFS_EMUBD_BADBLOCK_PROGNOOP',
|
||||
# 'LFS_EMUBD_BADBLOCK_ERASENOOP',
|
||||
'LFS_EMUBD_BADBLOCK_READERROR',
|
||||
'LFS_EMUBD_BADBLOCK_PROGNOOP',
|
||||
'LFS_EMUBD_BADBLOCK_ERASENOOP',
|
||||
]
|
||||
# we need prog checking to detect read errors
|
||||
defines.CHECK_PROGS = 'BADBLOCK_BEHAVIOR >= LFS_EMUBD_BADBLOCK_READERROR'
|
||||
defines.MIRROR = [false, true]
|
||||
defines.N = [1, 2, 4, 8, 16, 32, 64, 128, 256]
|
||||
# do more ops than dirs to encourage rename collisions
|
||||
@@ -723,11 +729,12 @@ defines.BADBLOCK = -1
|
||||
defines.BADBLOCK_BEHAVIOR = [
|
||||
'LFS_EMUBD_BADBLOCK_PROGERROR',
|
||||
'LFS_EMUBD_BADBLOCK_ERASEERROR',
|
||||
# TODO
|
||||
# 'LFS_EMUBD_BADBLOCK_READERROR',
|
||||
# 'LFS_EMUBD_BADBLOCK_PROGNOOP',
|
||||
# 'LFS_EMUBD_BADBLOCK_ERASENOOP',
|
||||
'LFS_EMUBD_BADBLOCK_READERROR',
|
||||
'LFS_EMUBD_BADBLOCK_PROGNOOP',
|
||||
'LFS_EMUBD_BADBLOCK_ERASENOOP',
|
||||
]
|
||||
# we need prog checking to detect read errors
|
||||
defines.CHECK_PROGS = 'BADBLOCK_BEHAVIOR >= LFS_EMUBD_BADBLOCK_READERROR'
|
||||
defines.N = [1, 2, 4, 8, 16, 32, 64]
|
||||
# do more ops than dirs to encourage rename collisions
|
||||
defines.OPS = '2*N'
|
||||
@@ -882,11 +889,12 @@ defines.ERASE_CYCLES = 0xffffffff
|
||||
defines.BADBLOCK_BEHAVIOR = [
|
||||
'LFS_EMUBD_BADBLOCK_PROGERROR',
|
||||
'LFS_EMUBD_BADBLOCK_ERASEERROR',
|
||||
# TODO
|
||||
# 'LFS_EMUBD_BADBLOCK_READERROR',
|
||||
# 'LFS_EMUBD_BADBLOCK_PROGNOOP',
|
||||
# 'LFS_EMUBD_BADBLOCK_ERASENOOP',
|
||||
'LFS_EMUBD_BADBLOCK_READERROR',
|
||||
'LFS_EMUBD_BADBLOCK_PROGNOOP',
|
||||
'LFS_EMUBD_BADBLOCK_ERASENOOP',
|
||||
]
|
||||
# we need prog checking to detect read errors
|
||||
defines.CHECK_PROGS = 'BADBLOCK_BEHAVIOR >= LFS_EMUBD_BADBLOCK_READERROR'
|
||||
defines.MIRROR = [false, true]
|
||||
defines.N = [1, 2, 4, 8, 16, 32, 64]
|
||||
# do more ops than dirs to encourage rename collisions
|
||||
@@ -1043,11 +1051,12 @@ defines.ERASE_CYCLES = 0xffffffff
|
||||
defines.BADBLOCK_BEHAVIOR = [
|
||||
'LFS_EMUBD_BADBLOCK_PROGERROR',
|
||||
'LFS_EMUBD_BADBLOCK_ERASEERROR',
|
||||
# TODO
|
||||
# 'LFS_EMUBD_BADBLOCK_READERROR',
|
||||
# 'LFS_EMUBD_BADBLOCK_PROGNOOP',
|
||||
# 'LFS_EMUBD_BADBLOCK_ERASENOOP',
|
||||
'LFS_EMUBD_BADBLOCK_READERROR',
|
||||
'LFS_EMUBD_BADBLOCK_PROGNOOP',
|
||||
'LFS_EMUBD_BADBLOCK_ERASENOOP',
|
||||
]
|
||||
# we need prog checking to detect read errors
|
||||
defines.CHECK_PROGS = 'BADBLOCK_BEHAVIOR >= LFS_EMUBD_BADBLOCK_READERROR'
|
||||
defines.MIRROR = [false, true]
|
||||
defines.N = [1, 2, 4, 8, 16, 32, 64]
|
||||
# do more ops than dirs to encourage rename collisions
|
||||
@@ -1206,11 +1215,12 @@ defines.BADBLOCK = -1
|
||||
defines.BADBLOCK_BEHAVIOR = [
|
||||
'LFS_EMUBD_BADBLOCK_PROGERROR',
|
||||
'LFS_EMUBD_BADBLOCK_ERASEERROR',
|
||||
# TODO
|
||||
# 'LFS_EMUBD_BADBLOCK_READERROR',
|
||||
# 'LFS_EMUBD_BADBLOCK_PROGNOOP',
|
||||
# 'LFS_EMUBD_BADBLOCK_ERASENOOP',
|
||||
'LFS_EMUBD_BADBLOCK_READERROR',
|
||||
'LFS_EMUBD_BADBLOCK_PROGNOOP',
|
||||
'LFS_EMUBD_BADBLOCK_ERASENOOP',
|
||||
]
|
||||
# we need prog checking to detect read errors
|
||||
defines.CHECK_PROGS = 'BADBLOCK_BEHAVIOR >= LFS_EMUBD_BADBLOCK_READERROR'
|
||||
defines.N = 20
|
||||
defines.SIZE = [
|
||||
'FBUFFER_SIZE/2',
|
||||
@@ -1379,11 +1389,12 @@ defines.ERASE_CYCLES = 0xffffffff
|
||||
defines.BADBLOCK_BEHAVIOR = [
|
||||
'LFS_EMUBD_BADBLOCK_PROGERROR',
|
||||
'LFS_EMUBD_BADBLOCK_ERASEERROR',
|
||||
# TODO
|
||||
# 'LFS_EMUBD_BADBLOCK_READERROR',
|
||||
# 'LFS_EMUBD_BADBLOCK_PROGNOOP',
|
||||
# 'LFS_EMUBD_BADBLOCK_ERASENOOP',
|
||||
'LFS_EMUBD_BADBLOCK_READERROR',
|
||||
'LFS_EMUBD_BADBLOCK_PROGNOOP',
|
||||
'LFS_EMUBD_BADBLOCK_ERASENOOP',
|
||||
]
|
||||
# we need prog checking to detect read errors
|
||||
defines.CHECK_PROGS = 'BADBLOCK_BEHAVIOR >= LFS_EMUBD_BADBLOCK_READERROR'
|
||||
defines.MIRROR = [false, true]
|
||||
defines.N = 20
|
||||
defines.SIZE = [
|
||||
@@ -1554,11 +1565,12 @@ defines.ERASE_CYCLES = 0xffffffff
|
||||
defines.BADBLOCK_BEHAVIOR = [
|
||||
'LFS_EMUBD_BADBLOCK_PROGERROR',
|
||||
'LFS_EMUBD_BADBLOCK_ERASEERROR',
|
||||
# TODO
|
||||
# 'LFS_EMUBD_BADBLOCK_READERROR',
|
||||
# 'LFS_EMUBD_BADBLOCK_PROGNOOP',
|
||||
# 'LFS_EMUBD_BADBLOCK_ERASENOOP',
|
||||
'LFS_EMUBD_BADBLOCK_READERROR',
|
||||
'LFS_EMUBD_BADBLOCK_PROGNOOP',
|
||||
'LFS_EMUBD_BADBLOCK_ERASENOOP',
|
||||
]
|
||||
# we need prog checking to detect read errors
|
||||
defines.CHECK_PROGS = 'BADBLOCK_BEHAVIOR >= LFS_EMUBD_BADBLOCK_READERROR'
|
||||
defines.MIRROR = [false, true]
|
||||
defines.N = 20
|
||||
defines.SIZE = [
|
||||
@@ -1731,11 +1743,12 @@ defines.BADBLOCK = -1
|
||||
defines.BADBLOCK_BEHAVIOR = [
|
||||
'LFS_EMUBD_BADBLOCK_PROGERROR',
|
||||
'LFS_EMUBD_BADBLOCK_ERASEERROR',
|
||||
# TODO
|
||||
# 'LFS_EMUBD_BADBLOCK_READERROR',
|
||||
# 'LFS_EMUBD_BADBLOCK_PROGNOOP',
|
||||
# 'LFS_EMUBD_BADBLOCK_ERASENOOP',
|
||||
'LFS_EMUBD_BADBLOCK_READERROR',
|
||||
'LFS_EMUBD_BADBLOCK_PROGNOOP',
|
||||
'LFS_EMUBD_BADBLOCK_ERASENOOP',
|
||||
]
|
||||
# we need prog checking to detect read errors
|
||||
defines.CHECK_PROGS = 'BADBLOCK_BEHAVIOR >= LFS_EMUBD_BADBLOCK_READERROR'
|
||||
defines.N = [1, 2, 4, 8, 16, 32, 64]
|
||||
defines.OPS = '2*N'
|
||||
defines.SIZE = [
|
||||
@@ -2172,11 +2185,12 @@ defines.ERASE_CYCLES = 0xffffffff
|
||||
defines.BADBLOCK_BEHAVIOR = [
|
||||
'LFS_EMUBD_BADBLOCK_PROGERROR',
|
||||
'LFS_EMUBD_BADBLOCK_ERASEERROR',
|
||||
# TODO
|
||||
# 'LFS_EMUBD_BADBLOCK_READERROR',
|
||||
# 'LFS_EMUBD_BADBLOCK_PROGNOOP',
|
||||
# 'LFS_EMUBD_BADBLOCK_ERASENOOP',
|
||||
'LFS_EMUBD_BADBLOCK_READERROR',
|
||||
'LFS_EMUBD_BADBLOCK_PROGNOOP',
|
||||
'LFS_EMUBD_BADBLOCK_ERASENOOP',
|
||||
]
|
||||
# we need prog checking to detect read errors
|
||||
defines.CHECK_PROGS = 'BADBLOCK_BEHAVIOR >= LFS_EMUBD_BADBLOCK_READERROR'
|
||||
defines.MIRROR = [false, true]
|
||||
defines.N = [1, 2, 4, 8, 16, 32, 64]
|
||||
defines.OPS = '2*N'
|
||||
@@ -2613,11 +2627,12 @@ defines.ERASE_CYCLES = 0xffffffff
|
||||
defines.BADBLOCK_BEHAVIOR = [
|
||||
'LFS_EMUBD_BADBLOCK_PROGERROR',
|
||||
'LFS_EMUBD_BADBLOCK_ERASEERROR',
|
||||
# TODO
|
||||
# 'LFS_EMUBD_BADBLOCK_READERROR',
|
||||
# 'LFS_EMUBD_BADBLOCK_PROGNOOP',
|
||||
# 'LFS_EMUBD_BADBLOCK_ERASENOOP',
|
||||
'LFS_EMUBD_BADBLOCK_READERROR',
|
||||
'LFS_EMUBD_BADBLOCK_PROGNOOP',
|
||||
'LFS_EMUBD_BADBLOCK_ERASENOOP',
|
||||
]
|
||||
# we need prog checking to detect read errors
|
||||
defines.CHECK_PROGS = 'BADBLOCK_BEHAVIOR >= LFS_EMUBD_BADBLOCK_READERROR'
|
||||
defines.MIRROR = [false, true]
|
||||
defines.N = [1, 2, 4, 8, 16, 32, 64]
|
||||
defines.OPS = '2*N'
|
||||
@@ -3058,11 +3073,12 @@ defines.BADBLOCKS = [0x1, 0x2, 0x3]
|
||||
defines.BADBLOCK_BEHAVIOR = [
|
||||
'LFS_EMUBD_BADBLOCK_PROGERROR',
|
||||
'LFS_EMUBD_BADBLOCK_ERASEERROR',
|
||||
# TODO
|
||||
# 'LFS_EMUBD_BADBLOCK_READERROR',
|
||||
# 'LFS_EMUBD_BADBLOCK_PROGNOOP',
|
||||
# 'LFS_EMUBD_BADBLOCK_ERASENOOP',
|
||||
'LFS_EMUBD_BADBLOCK_READERROR',
|
||||
'LFS_EMUBD_BADBLOCK_PROGNOOP',
|
||||
'LFS_EMUBD_BADBLOCK_ERASENOOP',
|
||||
]
|
||||
# we need prog checking to detect read errors
|
||||
defines.CHECK_PROGS = 'BADBLOCK_BEHAVIOR >= LFS_EMUBD_BADBLOCK_READERROR'
|
||||
code = '''
|
||||
if (BADBLOCKS & 0x1) {
|
||||
lfs_emubd_setwear(CFG, 0, 0xffffffff) => 0;
|
||||
|
||||
@@ -23,6 +23,15 @@ after = [
|
||||
[cases.test_exhaustion_dir_fuzz]
|
||||
defines.ERASE_CYCLES = 10
|
||||
defines.BLOCK_RECYCLES = 4
|
||||
defines.BADBLOCK_BEHAVIOR = [
|
||||
'LFS_EMUBD_BADBLOCK_PROGERROR',
|
||||
'LFS_EMUBD_BADBLOCK_ERASEERROR',
|
||||
'LFS_EMUBD_BADBLOCK_READERROR',
|
||||
'LFS_EMUBD_BADBLOCK_PROGNOOP',
|
||||
'LFS_EMUBD_BADBLOCK_ERASENOOP',
|
||||
]
|
||||
# we need prog checking to detect read errors
|
||||
defines.CHECK_PROGS = 'BADBLOCK_BEHAVIOR >= LFS_EMUBD_BADBLOCK_READERROR'
|
||||
defines.N = [1, 2, 4, 8, 16, 32, 64, 128, 256]
|
||||
defines.SEED = 42
|
||||
fuzz = 'SEED'
|
||||
@@ -213,6 +222,15 @@ code = '''
|
||||
[cases.test_exhaustion_file_fuzz]
|
||||
defines.ERASE_CYCLES = 10
|
||||
defines.BLOCK_RECYCLES = 4
|
||||
defines.BADBLOCK_BEHAVIOR = [
|
||||
'LFS_EMUBD_BADBLOCK_PROGERROR',
|
||||
'LFS_EMUBD_BADBLOCK_ERASEERROR',
|
||||
'LFS_EMUBD_BADBLOCK_READERROR',
|
||||
'LFS_EMUBD_BADBLOCK_PROGNOOP',
|
||||
'LFS_EMUBD_BADBLOCK_ERASENOOP',
|
||||
]
|
||||
# we need prog checking to detect read errors
|
||||
defines.CHECK_PROGS = 'BADBLOCK_BEHAVIOR >= LFS_EMUBD_BADBLOCK_READERROR'
|
||||
defines.N = [1, 2, 4, 8, 16, 32, 64]
|
||||
defines.SIZE = [
|
||||
'0',
|
||||
@@ -475,6 +493,15 @@ code = '''
|
||||
[cases.test_exhaustion_orphanzombie_fuzz]
|
||||
defines.ERASE_CYCLES = 10
|
||||
defines.BLOCK_RECYCLES = 4
|
||||
defines.BADBLOCK_BEHAVIOR = [
|
||||
'LFS_EMUBD_BADBLOCK_PROGERROR',
|
||||
'LFS_EMUBD_BADBLOCK_ERASEERROR',
|
||||
'LFS_EMUBD_BADBLOCK_READERROR',
|
||||
'LFS_EMUBD_BADBLOCK_PROGNOOP',
|
||||
'LFS_EMUBD_BADBLOCK_ERASENOOP',
|
||||
]
|
||||
# we need prog checking to detect read errors
|
||||
defines.CHECK_PROGS = 'BADBLOCK_BEHAVIOR >= LFS_EMUBD_BADBLOCK_READERROR'
|
||||
defines.N = [1, 2, 4, 8, 16, 32, 64]
|
||||
defines.SIZE = [
|
||||
'0',
|
||||
@@ -879,6 +906,15 @@ code = '''
|
||||
[cases.test_exhaustion_orphanzombiedir_fuzz]
|
||||
defines.ERASE_CYCLES = 10
|
||||
defines.BLOCK_RECYCLES = 4
|
||||
defines.BADBLOCK_BEHAVIOR = [
|
||||
'LFS_EMUBD_BADBLOCK_PROGERROR',
|
||||
'LFS_EMUBD_BADBLOCK_ERASEERROR',
|
||||
'LFS_EMUBD_BADBLOCK_READERROR',
|
||||
'LFS_EMUBD_BADBLOCK_PROGNOOP',
|
||||
'LFS_EMUBD_BADBLOCK_ERASENOOP',
|
||||
]
|
||||
# we need prog checking to detect read errors
|
||||
defines.CHECK_PROGS = 'BADBLOCK_BEHAVIOR >= LFS_EMUBD_BADBLOCK_READERROR'
|
||||
defines.N = [1, 2, 4, 8, 16, 32, 64]
|
||||
defines.SIZE = [
|
||||
'0',
|
||||
|
||||
Reference in New Issue
Block a user