Skip to content

power loss reboot triggered internal assert  #343

Open
@eastmoutain

Description

@eastmoutain

After random power loss and reboot, littlefs triggered internal assert, the function call trace is as below:

littlefs/littlefs/lfs.c:75 --> LFS_ASSERT(block < lfs->cfg->block_count);

littlefs/littlefs/lfs.c:2301 -> lfs_bd_read()

littlefs/littlefs/lfs.c:3786 -> lfs_ctz_traverse()

littlefs/littlefs/lfs.c:4093 -> lfs_fs_traverse()

littlefs/littlefs/lfs.c:1491 -> lfs_fs_size()

littlefs/littlefs/lfs.c:1812 -> lfs_dir_compact()

littlefs/littlefs/lfs.c:3145 -> lfs_dir_commit()

I added log, and found that block is 0x98fb7d37, it's an invalid block.

Littfs configuration:
block size: 4096 Bytes
block count: 4096
lookhead_size: 16 Bytes
rcache size: 256 Bytes
pcache size : 256 Bytes
cache size 256 Bytes

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions