File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -4210,6 +4210,15 @@ static int lfs_init(lfs_t *lfs, const struct lfs_config *cfg) {
4210
4210
LFS_ASSERT (lfs -> cfg -> compact_thresh == (lfs_size_t )- 1
4211
4211
|| lfs -> cfg -> compact_thresh <= lfs -> cfg -> block_size );
4212
4212
4213
+ // check that metadata_max is a multiple of read_size and prog_size,
4214
+ // and a factor of the block_size
4215
+ LFS_ASSERT (!lfs -> cfg -> metadata_max
4216
+ || lfs -> cfg -> metadata_max % lfs -> cfg -> read_size == 0 );
4217
+ LFS_ASSERT (!lfs -> cfg -> metadata_max
4218
+ || lfs -> cfg -> metadata_max % lfs -> cfg -> prog_size == 0 );
4219
+ LFS_ASSERT (!lfs -> cfg -> metadata_max
4220
+ || lfs -> cfg -> block_size % lfs -> cfg -> metadata_max == 0 );
4221
+
4213
4222
// setup read cache
4214
4223
if (lfs -> cfg -> read_buffer ) {
4215
4224
lfs -> rcache .buffer = lfs -> cfg -> read_buffer ;
You can’t perform that action at this time.
0 commit comments