[FEATURE] FAT: Add compile-time read-only configuration to reduce binary size
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- c
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- C
- スター
- 4.1k
- フォーク
- 1.7k
- 平均マージ
- 1日 3時間
- マージ済み PR(30日)
- 850
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
apache/nuttx のほかの issue
-
Arch: all Arch: arm Area: Build system OS: Linux Type: Bug
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
apache/nuttx#19435 · コメント 8 件 ·
メンテナーはふだん 1 日以内に返信
-
Type: Bug
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
apache/nuttx#17343 · コメント 4 件 ·
メンテナーはふだん 1 日以内に返信
-
Arch: all OS: Linux Type: Bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
apache/nuttx#16249 · コメント 7 件 ·
メンテナーはふだん 1 日以内に返信
-
Arch: simulator Arch: xtensa Area: Kernel OS: Mac Type: Bug
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
apache/nuttx#21499 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 75/100
メンテナーはふだん 10 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1〜3時間 初心者へのやさしさ 83/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
sk3llo/ffmpeg_kit_flutter#176 ·
-
Synth suite fails unless run from the repo root: signal_flow's default machine path is cwd-relativeオープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
Nimblesite/osprey#370 ·
メンテナーはふだん 1 日以内に返信