Commit 8f77de6
Seppo Takalo
TDBStore safety check: Erase if there is valid keys on the free space.
In case our are contains data from previous reset() or reset_area(),
we might end up in the situation where free space contains valid
key headers, but we have not erased that area yet. This can cause
failures if the deinit() and init() because new scan of that area
would continue as long as keys are found. This causes keys on the
not-yet-erased area to be included in the new instance of TDBStore.
To prevent this failure, check after each key-write that our free
space does not contain valid key headers. Also make sure that we
erase one program unit sector over the master record. If we erased
just the master record,first key might is still there, causing next
init() to find it. Extend erase area by one program unit, so that
build_ram_table() won't find any keys.1 parent a1cddba commit 8f77de6
2 files changed
+18
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
148 | 148 | | |
149 | 149 | | |
150 | 150 | | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
151 | 155 | | |
152 | 156 | | |
153 | 157 | | |
| |||
649 | 653 | | |
650 | 654 | | |
651 | 655 | | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
652 | 665 | | |
653 | 666 | | |
654 | 667 | | |
| |||
972 | 985 | | |
973 | 986 | | |
974 | 987 | | |
| 988 | + | |
975 | 989 | | |
976 | 990 | | |
977 | 991 | | |
| |||
1018 | 1032 | | |
1019 | 1033 | | |
1020 | 1034 | | |
| 1035 | + | |
1021 | 1036 | | |
1022 | 1037 | | |
1023 | 1038 | | |
| |||
1211 | 1226 | | |
1212 | 1227 | | |
1213 | 1228 | | |
1214 | | - | |
| 1229 | + | |
1215 | 1230 | | |
1216 | 1231 | | |
1217 | 1232 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
365 | 365 | | |
366 | 366 | | |
367 | 367 | | |
368 | | - | |
369 | | - | |
| 368 | + | |
| 369 | + | |
370 | 370 | | |
371 | 371 | | |
372 | 372 | | |
| |||
0 commit comments