#1122129 /usr/sbin/fsck.fat: fsck: repair of all-bits-set directory entires is broken

Package:
dosfstools
Source:
dosfstools
Description:
utilities for making and checking MS-DOS FAT filesystems
Submitter:
Joshua
Date:
2025-12-07 18:05:03 UTC
Severity:
normal
Tags:
#1122129#5
Date:
2025-12-07 18:02:39 UTC
From:
To:
Dear Maintainer,

The handling of all-bits-set directory entries is completely wrong.

All-bits-set directory entries occur when recovering from power-loss writes
to the directory sectors. These are not normal entries and need to be removed;
however dosfsck tries to repair them instead.

"Directory has non-zero size"
"Start cluster is beyond limit(65535 > 60886)"

Nope. It's not a directory as should be manifest as the volume label bit is set.
There is no sensible interpretation of such entries. They should always be removed.

https://github.com/joshudson/dossuperfloppy/raw/refs/heads/master/scantests/optionz.img.bz2

This is a test disk image. The filesystem starts on sector 63.

This test case is actually testing for correct handling of VFAT entires on hostile
filesystem alignment, so it looks a little bit different from my other, well-focused
test cases.