[FEATURE] FAT: Add compile-time read-only configuration to reduce binary size
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- c
- Área
- operating-systems
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- C
- Estrellas
- 4.1k
- Forks
- 1.7k
- Merge medio
- 1 d 3 h
- PR fusionados (30 d)
- 786
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de apache/nuttx
-
[BUG] drivers/net/lan9250.c: `.bss`/global `pktbuf` overflow in `lan9250_recv_buffer` — RX-status packet length bounded only by `DEBUGASSERT` (SPI path only)Posiblemente ocupada @SofianElmotiem la tomó hoy. AbiertoArch: all Area: Drivers OS: Linux Type: Bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
apache/nuttx#21112 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
apache/nuttx#19435 · 8 comentarios ·
Los mantenedores suelen responder en 1 día
-
Type: Bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
apache/nuttx#17343 · 4 comentarios ·
Los mantenedores suelen responder en 1 día
-
Arch: all OS: Linux Type: Bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
apache/nuttx#16249 · 7 comentarios ·
Los mantenedores suelen responder en 1 día
-
[BUG] arch/arm/stm32n6: USART hardware format and baud rate changes silently ignored at runtime (UE not disabled)Posiblemente ocupada @Swatantra-66 la tomó hoy. AbiertoArch: arm Area: Drivers OS: Linux Type: Bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 25/100
Los mantenedores suelen responder en 1 día
Todos los issues de apache/nuttx
Issues similares
-
Dificultad 2/5 Medio día Aptitud para principiantes 72/100
vercel-labs/scriptc#2910 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
darktable-org/darktable#22939 ·
Los mantenedores suelen responder en 1 día
-
os: input_password leaves terminal echo disabled when reading failsPosiblemente ocupada @davlgd la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
armv7l: `close`, `unlink` and `chroot` pass the kernel their argument's addressPosiblemente ocupada @aoinoikaz la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
colbymchenry/codegraph#3223 ·
Los mantenedores suelen responder en 1 día