fs/mnemofs: Add mnemofs version 1 support.#18884
Open
resyfer wants to merge 1 commit into
Open
Conversation
Contributor
Author
|
This changes the core design and dependencies of the structures of the file system. Since a file system, especially a tightly knit one like this, can't really work with some structures stuck in past and some being new, there was no hope for incremental changes even if I tried to find any. This is an essential rewrite of |
Split mnemofs into allocation, directory, file, CTZ, and read/write modules, and update direntry traversal and file handling. Add superblock format version 1 support, reject newer on-flash versions, and preserve the mounted version when rewriting metadata. Update the NAND simulator drivers for the new mnemofs behavior by fixing spare writes, exposing the erase state, allowing raw reads, and documenting the background-task startup flow. Signed-off-by: Saurav Pal <resyfer.dev@gmail.com>
Contributor
|
@resyfer please fix this issue: |
linguini1
approved these changes
May 15, 2026
Contributor
linguini1
left a comment
There was a problem hiding this comment.
Probably no one knows better about this than you!
Out of curiosity, has this ever been tried on real NAND flash yet? I would really love to use this FS.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Split mnemofs into allocation, directory, file, CTZ, and read/write modules, and update direntry traversal and file handling. Add superblock format version 1 support, reject newer on-flash versions, and preserve the mounted version when rewriting metadata.
Update the NAND simulator drivers for the new mnemofs behavior by fixing spare writes, exposing the erase state, allowing raw reads, and documenting the background-task startup flow.
Summary
The existing mnemofs implementation has a logic flaw which requires a huge amount of memory for the flush operation (which happens rarely, but happens). The fix to this required changes to the core of the file system design, hence the big changes.
Impact
Upon this review completing, mnemofs's structure should be free of any logic flaws, and hence should be good to be designated for the structure of version 1. Testing should only require changes to logic, not the structure.
Testing
This has been tested using the nand simulator. An example log of creating and writing to a file and reading its contents (
/hi/a/b/c.txt) along with the info/error logs (some parts have been truncated to be readable):