Added powerloss testing over lfsr_mkdir, fixed grm bugs

The grm bugs were mostly issues with:

1. Not maintaining the on-disk grm state in RAM (lfs->grm) correctly,
   this needs to be updated correctly after every commit or littlefs
   gets a confused.

2. lfsr_fs_fixgrm got a bit confused when it was missed when changing
   the no-rm encoding from 0 to -2. Added some inline functions to help
   avoid this in the future.

3. Leaking information due to mixing fixed sized and variable sized
   encodings of the grm delta in places. This is a bit tricky to write
   an assert for as we don't parse the full grm when we see a no-rm grm.
This commit is contained in:
Christopher Haster
2023-07-12 14:44:39 -05:00
parent b98ac119c7
commit 97f867b28d
3 changed files with 88 additions and 13 deletions
+1 -1
View File
@@ -673,7 +673,7 @@ def grepr(tag, data):
rid, d_ = fromleb128(data[d:]); d += d_
return 'grm %s' % (
'none' if op == 0
else 'rm 0x%x.%x' % (mid, rid) if op == 1
else 'rm %d.%d' % (mid, rid) if op == 1
else '0x%x' % op)
else:
return 'gstate 0x%02x %d' % (tag, len(data))