We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2d62d2f commit ea431bdCopy full SHA for ea431bd
lfs.c
@@ -4210,6 +4210,15 @@ static int lfs_init(lfs_t *lfs, const struct lfs_config *cfg) {
4210
LFS_ASSERT(lfs->cfg->compact_thresh == (lfs_size_t)-1
4211
|| lfs->cfg->compact_thresh <= lfs->cfg->block_size);
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
4218
+ || lfs->cfg->metadata_max % lfs->cfg->prog_size == 0);
4219
4220
+ || lfs->cfg->block_size % lfs->cfg->metadata_max == 0);
4221
+
4222
// setup read cache
4223
if (lfs->cfg->read_buffer) {
4224
lfs->rcache.buffer = lfs->cfg->read_buffer;
0 commit comments