You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The impact of this is after write to the limit of block size, it will do compact action.
Actually, it is not expected. So Could you help confirm about that?
The text was updated successfully, but these errors were encountered:
XiuChengZhao
changed the title
When I try to write the same file, I found the dir->off will increase
When I try to write the same file, I found the dir->off will increase without any decrease
Dec 24, 2024
Hi @XiuChengZhao, can confirm this is expected behavior.
dir->off is the current position of the log containing the file's metadata. Every time the file's metadata is updated, the new metadata is appended to the log, and old metadata is only removed when the block is full (the compaction operation you noticed).
This is how logs work, and is a consequence of the limitations of flash. In flash, writes are a two part operation: erase + program. Programs are relatively cheap, but erases are very expensive. So it's more efficient to append new metadata to a block than to rewrite the entire block. The downside is this moves more work into the compaction step, but it makes metadata updates more efficient on average.
This is a common in any filesystem targeting flags (SPIFFS, JFFS2, etc).
When I try to write the same file, I found the dir->off will increase
I only try to write the same content to the file, and found the dir->off continue to increase.
Does it is the normal phenomenon?
I think it do not need to increase the dir->off, because I only write the same content
my test code:
The impact of this is after write to the limit of block size, it will do compact action.
Actually, it is not expected. So Could you help confirm about that?
The text was updated successfully, but these errors were encountered: