fs/mnemofs: Add mnemofs version 1 support.#18884
Conversation
|
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 |
|
@resyfer please fix this issue: |
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.
He only tested on simulator, I will test here using W25N01GVZEIG NAND chip. |
|
Let me know how it goes! This would be great for a lot of devices I have planned. |
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>
|
I will have a NAND flash with me in a couple of days, and I can test it out on it. Should it better that we keep this PR open till the actual hardware is confirmed? |
|
To the best of my knowledge, wasn't the old version only tested on a simulator? If so, this PR is fine to merge before the hardware tests since it's was never guaranteed to work on real hardware. If you find some issues then you can upstream patches which will hopefully be smaller |
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):