mirror of
https://github.com/morluto/rea.git
synced 2026-11-12 01:41:21 +00:00
fix(ntfs): retain incomplete coverage alongside fixup mismatches
Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
This commit is contained in:
1 parent
466149169e
commit
7712e3185e
2 files changed
+18
-1
No files matched your search
@@ -239,6 +239,20 @@ describe("MFT fixup coverage", () => {
|
||||
},
|
||||
);
|
||||
|
||||
it("counts uncovered sectors independently of a mismatched trailer", () => {
|
||||
const parsed = parseMftImage(
|
||||
recordOf({ recordBytes: 4096, usaEntries: 3, corruptSector: 0 }),
|
||||
);
|
||||
if (!parsed.ok) throw new Error(parsed.error.message);
|
||||
expect(parsed.value.metadata).toMatchObject({
|
||||
fixup_mismatch_count: 1,
|
||||
fixup_unverified_record_count: 1,
|
||||
});
|
||||
expect(parsed.value.limitations.join(" ")).toContain(
|
||||
"invalid or incomplete",
|
||||
);
|
||||
});
|
||||
|
||||
it("reports an array that covers fewer sectors than the record has", () => {
|
||||
// A 4 KiB record holds eight sectors; a three-entry array leaves five unverified.
|
||||
const parsed = parseMftImage(
|
||||
|
||||
@@ -284,7 +284,10 @@ const scanMft = (
|
||||
if (record.directory) directoryCount += 1;
|
||||
if (record.baseRecordReference !== null) extensionCount += 1;
|
||||
if (record.fixups.mismatchSector !== null) mismatchCount += 1;
|
||||
else if (record.fixups.verifiedSectors < recordBytes / FIXUP_SECTOR_BYTES)
|
||||
if (
|
||||
record.fixups.malformed ||
|
||||
record.fixups.coveredSectors < recordBytes / FIXUP_SECTOR_BYTES
|
||||
)
|
||||
unverifiedCount += 1;
|
||||
if (!record.extentValid) {
|
||||
invalidExtents += 1;
|
||||
|
||||
Reference in new issue
Block a user