Repository navigation
fs: Report corrupted exFAT as not clean instead of failing - #1226
Conversation
fsck.exfat from exfatprogs exits with 4 when it finds errors it didn't fix, which is always the case with "-n". bd_fs_exfat_check only cleared the error for exit code 1, so checking a corrupted exFAT file system failed with an error instead of returning FALSE. The ext check already handles exit code 4 the same way. Assisted-by: Claude Code (Claude Opus 5.5)
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
vojtechtrefny
left a comment
There was a problem hiding this comment.
Looks good to me, thank you.
282f3a6
into
storaged-project:master
Hi!
bd_fs_exfat_checkfails with an error on a corrupted exFAT file system instead of returningFALSE.fsck.exfatfrom exfatprogs exits with 4 (FSCK_EXIT_ERRORS_LEFT) whenever it finds errors it didn't fix, which with-nmeans any error, but the check only cleared the error for exit code 1. udisks passes that error on, soFilesystem.Checkfails with "Error checking filesystem" instead of returningfalse. The ext check already treats exit code 4 this way.One edge case: exfatprogs 1.3.2 also exits with 4 when reading the root directory fails, so with that version such a read error now comes back as "not clean" instead of as an error. exfatprogs 1.4.4 exits with 8 there, which is still reported as an error.
The new test zeroes the checksum sector of the main boot region, then expects the check to return
FALSE, the repair to succeed and a second check to returnTRUE. Without the fix it fails with "Process reported exit code 4".I ran
ExfatTestCheckandExfatTestRepairwith exfatprogs 1.4.4 on plain image files instead of LIO devices, because I can't run the suite as root here. While doing that I noticed that exfatprogs 1.4.4 prints its version to stderr, so_get_exfatprogs_versioninexfat_test.pydoesn't find it (#1225). I worked around that locally and left it out of this PR.I used Claude Code (Claude Opus 5.5) to investigate, write and test this change and this description, and reviewed both myself.
I reviewed this first in my fork, in davidvornholt#1. The code is unchanged since then.
Summary by CodeRabbit