diff options
author | Christopher Haster <chaster@utexas.edu> | 2017-11-10 04:10:08 +0300 |
---|---|---|
committer | Christopher Haster <chaster@utexas.edu> | 2017-11-10 19:53:30 +0300 |
commit | f4aeb8331a5e0d8c5d476d738f47066d399735ce (patch) | |
tree | 879e8dbd0837da041bb12b3f538fec735fc6c024 /lfs.h | |
parent | db51a395bab7f32479c4a4f09bb44f19eec014a1 (diff) |
Fixed issue with aggressively rounding down lookahead configuration
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.
Diffstat (limited to 'lfs.h')
-rw-r--r-- | lfs.h | 1 |
1 files changed, 0 insertions, 1 deletions
@@ -236,7 +236,6 @@ typedef struct lfs_superblock { } lfs_superblock_t; typedef struct lfs_free { - lfs_size_t lookahead; lfs_block_t begin; lfs_block_t end; lfs_block_t off; |