Add tests for filesystem resilience and wear leveling. These tests
take shared filesystem code and simulate different scenarios while
this code is running. Information on the new tests can be found below.
mbed-littlefs-tests-filesystem_recovery-resilience:
Tests that after every block device operation the filesystem is in a
well defined state.
mbed-littlefs-tests-filesystem_recovery-wear_leveling:
Tests that the littlefs correctly handles when flash is exhausted by
using a simulated block device until there are no free good blocks.
Note - This patch also adds several new block devices for testing.
These will eventually be moved into mbed-os.
78c79ec Added QUIET flag to tests so CI is readable
f9f4f5c Fixed standard name mismatch LFS_ERR_EXISTS -> LFS_ERR_EXIST
843e3c6 Added sticky-bit for preventing file syncs after write errors
2612e1b Modified lfs_ctz_extend to be a little bit safer
6664723 Fixed issue with committing directories to bad-blocks that are stuck
git-subtree-dir: littlefs
git-subtree-split: 78c79ecb9e6b8dd0e7cfd7ac86934e43fb026924
3f31c8c Fixed corner case with immediate exhaustion and lookahead==block_count
f4aeb83 Fixed issue with aggressively rounding down lookahead configuration
db51a39 Removed stray newline in LFS_ERROR for version
git-subtree-dir: littlefs
git-subtree-split: 3f31c8cba31e0f6cef5b02dba2e050d8df1168b7
The previous math for determining if we scanned all of disk wasn't set
up correctly in the lfs_mount function. If lookahead == block_count
the lfs_alloc function would think we had already searched the entire
disk.
This is only an issue if we manage to exhaust a block on the first
pass after mount, since lfs_alloc_ack resets the lookahead region
into a valid state after a succesful block allocation.
The littlefs allows buffers to be passed statically in the case
that a system does not have a heap. Unfortunately, this means we
can't round up in the case of an unaligned lookahead buffer.
Double unfortunately, rounding down after clamping to the block device
size could result in a lookahead of zero for block devices < 32 blocks
large.
The assert in littlefs does catch this case, but rounding down prevents
support for < 32 block devices.
The solution is to simply require a 32-bit aligned buffer with an
assert. This avoids runtime problems while allowing a user to pass
in the correct buffer for < 32 block devices. Rounding up can be
handled at higher API levels.
2ab150c Removed toolchain specific warnings
0825d34 Adopted alternative implementation for lfs_ctz_index
46e22b2 Adopted lfs_ctz_index implementation using popcount
4fdca15 Slight name change with ctz skip-list functions
git-subtree-dir: littlefs
git-subtree-split: 2ab150cc500d5b8233ec8ef6109efa363bf1d38c
454b588 Updated SPEC.md and DESIGN.md based on recent changes
f3578e3 Removed clamping to block size in ctz linked-list
83d4c61 Updated copyright
539409e Refactored deduplicate/deorphan step to single deorphan step
2936514 Added atomic move using dirty tag in entry type
ac9766e Added self-hosting fuzz test using littlefs-fuse
9db1a86 Added specification document
git-subtree-dir: littlefs
git-subtree-split: 454b588f73032f9621c264fba280ab7b3a216402
9843402 Fixed incorrect return value from lfs_file_seek
273cb7c Fixed problem with lookaheads larger than block device
d9367e0 Fixed collection of multiblock directories
a83b2fe Added checks for out-of-bound seeks
a8fa5e6 Fixed some corner cases with paths
26dd49a Fixed issue with negative modulo with unaligned lookaheads
0982020 Fixed issue with cold-write after seek to block boundary
git-subtree-dir: littlefs
git-subtree-split: 984340225befc1e2330dd3b88f4048373eda0fce
Because lookahead is stored efficiently as a bit-vector, this only
requires a ram increase of 48 bytes (2.1% of benchmark), but decreases
the SD benchmark runtime cost by 32 seconds (21.9% of benchmark).
Note this is unimportant on devices with byte-reads such as NOR flash.
c2283a2 Extended entry tag to support attributes
8795f0e Added build size output to CI
47db7a7 Added sanity check for compiling example
476915f Removed a few "what"s from the documentation
git-subtree-dir: littlefs
git-subtree-split: c2283a2753619d82a1fdf27d799cd53f2eef9a80
- Changed log statements to use the debug function
- Changed %d to %ld given the type of int32_t in arm-none-eabi-gcc. In
mainstream gcc this is not the case and may cause problems to
upstream.