File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -120,6 +120,18 @@ really do anything to ensure that the data written to disk is machine portable.
120
120
This is fine as long as all of the involved machines share endianness
121
121
(little-endian) and don't have strange padding requirements.
122
122
123
+ In the configuration struct, the `prog` and `erase` function provided by the
124
+ user may return a `LFS_ERR_CORRUPT` error if the implementation already can
125
+ detect corrupt blocks. However, the wear leveling does not depend on the return
126
+ code of these functions, instead all data is read back and checked for
127
+ integrity.
128
+
129
+ If your storage caches writes, make sure that the provided `sync` function
130
+ flushes all the data to memory and ensures that the next read fetches the data
131
+ from memory, otherwise data integrity can not be guaranteed. If the `write`
132
+ function does not perform caching, and therefore each `read` or `write` call
133
+ hits the memory, the `sync` function can simply return 0.
134
+
123
135
## Reference material
124
136
125
137
[DESIGN.md](DESIGN.md) - DESIGN.md contains a fully detailed dive into how
You can’t perform that action at this time.
0 commit comments