[FEATURE] FAT: Add compile-time read-only configuration to reduce binary size
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- c
- Lĩnh vực
- operating-systems
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- C
- Star
- 4.1k
- Fork
- 1.7k
- Merge trung bình
- 1 ngày 3 giờ
- Pull request đã merge (30 ngày)
- 836
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của apache/nuttx
-
Please rerun `pre-commit run -a`Đang mởArch: all Arch: arm Area: Build system OS: Linux Type: Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
apache/nuttx#19435 · 8 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Type: Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
apache/nuttx#17343 · 4 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Arch: all OS: Linux Type: Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
apache/nuttx#16249 · 7 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 35/100
apache/nuttx#21248 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
Issue tương tự
-
[compiler-rt] Rtsan-aarch64-NoInstTest: error: no such file or directory: 'NOTFOUND' (libatomic)Đang mởbuild-problem compiler-rt:rtsan platform:linux
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 63/100
llvm/llvm-project#239039 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
component:obi contribfest go test
Độ khó 2/5 Dưới một giờ Mức phù hợp với người mới 83/100
open-telemetry/opentelemetry-ebpf-instrumentation#4143 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
checkpoint-restore/criu#3304 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Separate Installation Commands into Individual Code BlocksCó thể đã có người làm @andrySD đã nhận hôm nay. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
colbymchenry/codegraph#3241 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
opcache: smm_shared_globals left pointing to a dead stack frame when there is no SHM backendĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày