Skip to content

Commit 25ee90f

Browse files
committed
Clarified what is accessible at specific superblock offsets in SPEC.md
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.
1 parent a60a986 commit 25ee90f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

SPEC.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -441,9 +441,10 @@ Superblock fields:
441441

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

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

448449
---
449450
#### `0x2xx` LFS_TYPE_STRUCT

0 commit comments

Comments
 (0)