# When removing a duplicate block claim does not recover the original files

A repaired pointer graph can satisfy a uniqueness rule while still assigning the
wrong bytes to a file. Keeping a copy for each claimant does not determine who
originally owned the payload.

## Historical evidence

Gunawi, Rajimwale and the Arpaci-Dusseaus' [SQCK paper (OSDI 2008)](https://www.usenix.org/legacy/events/osdi08/tech/full_papers/gunawi/gunawi_html/index.html),
sections 2.3-2.4 and 3.3.3, separates structural repair from information preservation,
layout policy and confidentiality. It discusses block cloning and administrator-selected
policies. Its ext2/e2fsck 1.39 observations are historical, not a present-day defect claim.

The [Solaris UFS administration guide](https://docs.oracle.com/cd/E19120-01/open.solaris/819-2723/fstroublefsck-24589/index.html),
under Duplicate Block Checks, says competing inode claims do not establish with
certainty which inode is wrong. Its Regular Data Blocks section distinguishes
metadata checking from validation of ordinary file contents. These are UFS-specific
instructions, not a universal description of modern filesystems.

## Two histories, one damaged observation

This original finite example has two files, named public and private, and two
distinct payloads: block 1 contains X and block 2 contains Y. The names denote
separate access domains; they do not simulate operating-system permissions.

| Candidate original state | Public file | Private file | One corrupted pointer |
| --- | --- | --- | --- |
| A | block 1, X | block 2, Y | private changes from 2 to 1 |
| B | block 2, Y | block 1, X | public changes from 2 to 1 |

Both histories leave the same block contents and observed pointer map: both
files claim block 1. Block 2 still contains Y, but its former owner is unknown.
There is no trusted owner record, content manifest, original pointer map or
allocation history in the observation. Reflinks and intentional block sharing
are excluded.

| Chosen action | Unique physical claims afterward? | Both originals recovered in A? | Both originals recovered in B? |
| --- | --- | --- | --- |
| Detach private's claim | yes | no | no |
| Detach public's claim | yes | no | no |
| Copy X to block 3 for public; retain block 1 for private | yes | no | no |

The last action gives both files X. In history B, that places private's original
payload in public's file. The pointer conflict is gone; the ownership question is
not. The detached-file cases also lose a reachable original payload.

Choosing the original map from A reconstructs A but misassigns both payloads
under B. Choosing B reverses the outcome. Any procedure seeing only this identical
observation must make the same decision for both histories; it cannot promise
exact original reconstruction for both. This is an identifiability argument,
not an estimated probability or a claim that useful recovery is always impossible.

## Acceptance decisions

Separate structural checks, byte preservation, original file-to-content mapping
and allowed access. A locality preference can guide placement without identifying
the rightful owner. An administrator may prefer retaining ambiguous bytes in a
restricted recovery area over exposing them through an ordinary pathname.

A trusted backup, authenticated file manifest or reliable independent metadata
could distinguish the candidates. Its identity and freshness would then be part
of the recovery claim. A hash computed only after corruption confirms the
observed bytes, not the original owner.

## Reproduce

Run with Node.js, using only standard-library modules:

```sh
node model.mjs --check
node --test model.test.mjs
```

[Model](./model.mjs), [tests](./model.test.mjs), [generated results](./results.json)
and [source provenance](./evidence.json) are downloadable. Six outcome rows are
the three chosen policies evaluated under two candidate histories. They are not
six observed incidents and do not imply equal likelihood of either history.

No filesystem image, repair binary, fault injector or storage device is used.
This is not a SQCK reproduction, vulnerability demonstration, benchmark, or
recommendation to run a repair command on an original disk.
