Skip to content

Commit

Permalink
Clarified what is accessible at specific superblock offsets in SPEC.md
Browse files Browse the repository at this point in the history
It used to be the case that the entire superblock entry could be found
at specific offsets, but this was only possible while the superblock
entry was immutable. Now that the superblock entry is very mutable
(block-count changes, lfs2.0 -> lfs2.1 version bumps, etc), the correct
superblock entry may end up later in the metadata log.

At the very least, the "littlefs" magic string is still immutable and at
the specific offset offset=8. This is arguably the most useful
fixed-offset item.
  • Loading branch information
geky committed Mar 19, 2024
1 parent a60a986 commit 25ee90f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions SPEC.md
Original file line number Diff line number Diff line change
Expand Up @@ -441,9 +441,10 @@ Superblock fields:

7. **Attr max (32-bits)** - Maximum size of file attributes in bytes.

The superblock must always be the first entry (id 0) in a metadata pair as well
as be the first entry written to the block. This means that the superblock
entry can be read from a device using offsets alone.
The superblock must always be the first entry (id 0) in the metadata pair, and
the name tag must always be the first tag in the metadata pair. This makes it
so that the magic string "littlefs" will always reside at offset=8 in a valid
littlefs superblock.

---
#### `0x2xx` LFS_TYPE_STRUCT
Expand Down

0 comments on commit 25ee90f

Please sign in to comment.