Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/littlefs-project/littlefs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lfs.h
diff options
context:
space:
mode:
authorChristopher Haster <chaster@utexas.edu>2017-06-24 08:43:05 +0300
committerChristopher Haster <chaster@utexas.edu>2017-06-28 23:50:47 +0300
commitfe28ea0f93ca550acda24a7490d1e2d1e591daec (patch)
tree5544b207dfddea10bd4b9ca27181fd734dc52efd /lfs.h
parent1eeb2a6811b936d3551a26c94aeafa3039535d4d (diff)
Added internal check of data written to disk
Before, the littlefs relied on the underlying block device to report corruption that occurs when writing data to disk. This requirement is easy to miss or implement incorrectly, since the error detection is only required when a block becomes corrupted, which is very unlikely to happen until late in the block device's lifetime. The littlefs can detect corruption itself by reading back written data. This requires a bit of care to reuse the available buffers, and may rely on checksums to avoid additional RAM requirements. This does have a runtime penalty with the extra read operations, but should make the littlefs much more robust to different implementations.
Diffstat (limited to 'lfs.h')
-rw-r--r--lfs.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/lfs.h b/lfs.h
index d36b137..a62bda3 100644
--- a/lfs.h
+++ b/lfs.h
@@ -32,7 +32,7 @@ typedef uint32_t lfs_block_t;
enum lfs_error {
LFS_ERR_OK = 0, // No error
LFS_ERR_IO = -5, // Error during device operation
- LFS_ERR_CORRUPT = -77, // Corrupted
+ LFS_ERR_CORRUPT = -52, // Corrupted
LFS_ERR_NOENT = -2, // No directory entry
LFS_ERR_EXISTS = -17, // Entry already exists
LFS_ERR_NOTDIR = -20, // Entry is not a dir