[FEATURE] FAT: Add compile-time read-only configuration to reduce binary size
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- c
- Ambito
- operating-systems
Direzione di ricerca
Start with the g_fat_operations table in fs/fat/fs_fat32.c to see which write entry points it references, then read fs/fat/Kconfig to see where a new CONFIG_FS_FAT_READONLY option would sit. Done means that with the option enabled, write operations return -EROFS, the write-only helpers are compiled out, and read and directory paths behave as before. With the option disabled, the build should be unchanged. Agree the scope with maintainers first, since the issue does not list which functions to remove.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Is your feature request related to a problem? Please describe.
Currently, FAT keeps its write-side functions reachable through g_fat_operations in fs/fat/fs_fat32.c, even when an application only needs read access.
This prevents the linker from removing unused write-related code, increasing binary size on resource-constrained targets.
There is currently no compile-time read-only option in fs/fat/Kconfig. The existing FATATTR_READONLY attribute only applies to individual files.
This also relates to the binary-size discussion in #20414.
Describe the solution you'd like
Introduce an optional CONFIG_FS_FAT_READONLY configuration.
When enabled, it should:
- Exclude unnecessary write-side functions and helpers at compile time.
- Reject write operations gracefully, preferably with
-EROFS. - Preserve normal read operations, directory enumeration and filesystem lifecycle.
The implementation should also ensure that write-related references in g_fat_operations don't prevent dead-code elimination.
The existing FAT behaviour should remain unchanged when the option is disabled.
Describe alternatives you've considered
- Relying on linker garbage collection alone, which cannot remove functions referenced by the operations table.
- Using
FATATTR_READONLY, which only protects individual files. - Runtime read-only handling, which doesn't eliminate the unused write-side code.
A compile-time option seems more suitable for systems that never need FAT write functionality.
Verification
- I have verified before submitting the report.
- Lingua principale
- C
- Stelle
- 4.1k
- Fork
- 1.7k
- Merge medio
- 1g 3h
- PR unite (30g)
- 872
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di apache/nuttx
-
Arch: all Arch: arm Area: Build system OS: Linux Type: Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
apache/nuttx#19435 · 8 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Type: Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
apache/nuttx#17343 · 4 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Arch: all OS: Linux Type: Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
apache/nuttx#16249 · 7 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 35/100
apache/nuttx#21248 · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di apache/nuttx
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
containers/bubblewrap#826 ·
I maintainer di solito rispondono entro 1 giorno
-
Vulkan: create_device reads the device extension list after freeing it (random crash at start)Aperta
Difficoltà 1/5 1-3 ore Idoneità per principianti 62/100
Revivedx/SavageWindRecomp#488 ·
I maintainer di solito rispondono entro 1 giorno
-
needs-device
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
feature/themes QA/No release-notes/exclude tests tests/missing-coverage tests/test-quality
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
brave/brave-browser#60971 ·
I maintainer di solito rispondono entro 1 giorno