Skip to content

docs: S23.22 drop the FatFs sector floor and its porting-guide example - #772

Merged
DavidCozens merged 1 commit into
mainfrom
docs/fatfs-sector-comment
Aug 17, 2026
Merged

docs: S23.22 drop the FatFs sector floor and its porting-guide example#772
DavidCozens merged 1 commit into
mainfrom
docs/fatfs-sector-comment

Conversation

@DavidCozens

@DavidCozens DavidCozens commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator

Purpose

The last loose end on #708. The audit recorded that Platform/PlusFat/ has no
compile-time sector-size check where Platform/FatFs/ has one, and asked whether
that gap needed closing. Investigating it showed the check itself is the thing to
remove.

Change Description

The check goes. It rejected a file-block-size default below one FatFs sector,
on the stated grounds that a smaller block cannot back a coherent on-disk record
layout. It can. Nothing in SolidSyslogFileBlockDevice.c,
SolidSyslogBlockSequence.c or SolidSyslogBlockStore.h assumes sector alignment
or an atomic block write - records are self-framed and integrity-checked by the
SecurityPolicy - and the adapter writes through byte-granular f_write, so the
filesystem does the read-modify-write. A sub-sector block is inefficient, not
incorrect, and enforcing the integrator's media geometry is not this library's
business.

Two further reasons it was not earning its place:

  • It only ever covered the default. SolidSyslogFileBlockDevice_Create takes
    blockSize as a runtime parameter, and any non-zero value bypassed it. The floor
    that is load-bearing - one worst-case record - stays in
    SolidSyslogTunablesDefaults.h, unconditional and for every backend.
  • It was the only #error outside that header, and the only one guarding
    efficiency rather than a value below which the library cannot work.

Plus-FAT needs no equivalent, and now no explanation. FF_MAX_SS is a FatFs
macro; FreeRTOS+FAT publishes no compile-time sector-size macro at all, taking the
sector size as a runtime argument at disk init, so #527's acceptance criterion was
never expressible for that backend. Removing this check settles the asymmetry
rather than documenting it, and the two FAT adapters now have the same shape.

SolidSyslogTunables.h goes with it - that translation unit used no other
tunable macro. It stays in SolidSyslogFatFsFileStatic.c, which needs the pool
size.

docs/porting.md loses a section. Its rule for choosing between an #error
and a build gate cited this check as its worked example, and the tree now has no
platform-side #error to put in its place. The guide is for porters adding an
adapter rather than a tutorial on preprocessor directives, so the section goes
rather than acquiring a hypothetical. Worth noting that the check failed that
section's own criterion - "the integrator is using the class and their
configuration contradicts it" - which is what prompted looking at it.

Test Evidence

  • clang-format --dry-run --Werror over the whole tree: clean.
  • scripts/misra_renumber.py --apply, run after the format check: the 11.3 entry
    for this file moves 63 -> 53, one line off its Plus-FAT sibling at 52.
  • markdownlint-cli2 v0.22.1 over all 64 files: 0 errors.
  • No build was run. The FatFs pack needs the vendor tree, and the change deletes a
    preprocessor block and an include with no other use in that translation unit.

Areas Affected

Platform/FatFs/Source/SolidSyslogFatFsFile.c, docs/porting.md,
misra_suppressions.txt. No behaviour change and no API change: an integrator who
previously hit the #error now builds and writes sub-sector blocks, which works.

Closes #708

@coderabbitai

coderabbitai Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

An error occurred during the review process. Please try again later.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: fd77db3b-3c88-4a54-8d3a-8eaf312186ed

📥 Commits

Reviewing files that changed from the base of the PR and between 842c434 and 574adde.

📒 Files selected for processing (1)
  • Platform/FatFs/Source/SolidSyslogFatFsFile.c

Included review availability: 1 review is currently available. Based on recent review activity, included reviews refill at 2 per hour.


Walkthrough

The change revises the block-size validation comment to describe sector-level read-modify-write operations for sub-sector blocks. The FF_MAX_SS preprocessor validation remains unchanged.

Changes

Comment quality

Layer / File(s) Summary
Block-size validation comment
Platform/FatFs/Source/SolidSyslogFatFsFile.c
The comment now documents the performance effect of sub-sector block sizes. The validation guard is unchanged.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Merge Risk: ⚪ Minimal · up to 574ad

This PR corrects documentation for an existing FatFs sector-size check without changing behavior or APIs; no actionable merge-blocking risk remains after normal checks and review.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title states that the FatFs sector floor and porting-guide example were removed, but the changeset only updates a comment and preserves the check. Rename the PR to describe the comment correction, for example: docs: clarify FatFs sector-floor performance rationale.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The PR corrects the FatFs comment finding and records the rationale for the related Plus-FAT decision [#708].
Out of Scope Changes check ✅ Passed The only code change is an in-scope source-comment correction in the FatFs platform layer [#708].
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed The description contains all required sections and provides detailed purpose, changes, test evidence, and affected areas.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/fatfs-sector-comment

Comment @coderabbitai help to get the list of available commands.

The check rejected a file-block-size default below one FatFs sector, on the
stated grounds that a smaller block cannot back a coherent on-disk record
layout. It can. Nothing in Core assumes sector alignment or an atomic block
write - records are self-framed and integrity-checked by the SecurityPolicy -
and the adapter writes through byte-granular f_write, so the filesystem does
the read-modify-write. A sub-sector block is inefficient, not incorrect, and
enforcing the integrator's media geometry is not this library's business.

It also only ever covered the default: SolidSyslogFileBlockDevice_Create takes
blockSize as a runtime parameter that bypasses it. The floor that is
load-bearing - one worst-case record - stays in SolidSyslogTunablesDefaults.h,
unconditional and for every backend.

FreeRTOS+FAT never got the equivalent check because it has no equivalent macro:
it takes the sector size as a runtime argument at disk init. Removing this one
settles that asymmetry rather than explaining it, and the two FAT adapters now
have the same shape.

The porting guide's rule for choosing between an #error and a build gate cited
this check as its worked example, and no longer has one. The section goes with
it: the guide is for porters adding an adapter, not a tutorial on preprocessor
directives.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@DavidCozens
DavidCozens force-pushed the docs/fatfs-sector-comment branch from 574adde to 64fb695 Compare August 17, 2026 13:48
@DavidCozens DavidCozens changed the title docs: S23.22 say what the FatFs sector floor actually guards docs: S23.22 drop the FatFs sector floor and its porting-guide example Aug 17, 2026
@github-actions

Copy link
Copy Markdown
Contributor

☀️   Quality Summary

   JUnit   build-linux-gcc (Whole Project): ✅ successful — 1532 passed
   JUnit   build-freertos-host-tdd-plustcp (Whole Project): ✅ successful — 1884 passed
   JUnit   build-linux-clang (Whole Project): ✅ successful — 1463 passed
   JUnit   sanitize-linux-gcc (Whole Project): ✅ successful — 1463 passed
   JUnit   integration-linux-openssl (Whole Project): ✅ successful — 16 passed
   JUnit   integration-linux-mbedtls (Whole Project): ✅ successful — 14 passed
   JUnit   integration-windows-openssl (Whole Project): ✅ successful — 16 passed
   JUnit   bdd-linux-syslog-ng (Whole Project): ✅ successful — 49 passed, 3 skipped
   JUnit   bdd-windows-otel (Whole Project): ✅ successful — 46 passed, 6 skipped
   JUnit   bdd-freertos-qemu-plustcp (Whole Project): ✅ successful — 45 passed, 7 skipped
   JUnit   bdd-freertos-qemu-lwip (Whole Project): ✅ successful — 45 passed, 7 skipped
   JUnit   build-windows-msvc (Whole Project): ✅ successful — 1305 passed
   JUnit   build-linux-tunable-override (Whole Project): ✅ successful — 1463 passed
   ⚠️   Clang-Tidy (Whole Project): No warnings
   ⚠️   CPPCheck (Whole Project): No warnings


Created by Quality Monitor v4.15.0 (#82d77af). More details are shown in the GitHub Checks Result.

@DavidCozens
DavidCozens merged commit 8518ab6 into main Aug 17, 2026
71 of 72 checks passed
@DavidCozens
DavidCozens deleted the docs/fatfs-sector-comment branch August 17, 2026 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

S23.22: final documentation and comment quality gate before 0.1.0

1 participant