Skip to content

Commit 948448b

Browse files
committed
docs(filetxn): record the ReFS identity limit and the long-path basis
- identity_windows.go and docs/verification.md state that directory identity on ReFS volumes is not guaranteed unique, pointing to #389, so the limit lives in the repository and not only in the PR. - identity_windows_test.go explains why the MAX_PATH subtest holds on every supported host: the Go runtime opts into long-path support at startup, and the os package then adds no \?\ prefix either. - identity_test.go is constrained to unix || windows, the platforms with an identity source; elsewhere identity_other.go refuses by design, so the portable assertions do not apply. Refs #370
1 parent 4e3e08c commit 948448b

4 files changed

Lines changed: 12 additions & 1 deletion

File tree

‎docs/verification.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ curl -fL -O https://github.com/refactor-ia/cortex/releases/download/v0.1.0-alpha
1313
shasum -a 256 -c --ignore-missing SHA256SUMS && tar xzf "$archive"
1414
```
1515

16-
On Linux, set `archive=cortex_v0.1.0-alpha.8_linux_amd64.tar.gz` and use `sha256sum -c --ignore-missing SHA256SUMS` instead of the macOS checksum line. macOS arm64 and Linux amd64 are the published targets; Windows is not supported: it builds from source, but its filesystem transaction behavior is not yet verified.
16+
On Linux, set `archive=cortex_v0.1.0-alpha.8_linux_amd64.tar.gz` and use `sha256sum -c --ignore-missing SHA256SUMS` instead of the macOS checksum line. macOS arm64 and Linux amd64 are the published targets; Windows is not supported: it builds from source, but its filesystem transaction behavior is not yet verified, and directory identity on ReFS volumes is not guaranteed unique (see #389).
1717

1818
### Building from source
1919

‎internal/filetxn/identity_test.go‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//go:build unix || windows
2+
13
package filetxn
24

35
import (

‎internal/filetxn/identity_windows.go‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ func directoryIdentity(path string, info os.FileInfo) (device, inode uint64, ok
4444
if err != nil || !os.SameFile(info, opened) {
4545
return 0, 0, false
4646
}
47+
// The file index is the full NTFS file ID. ReFS volumes (including Dev
48+
// Drives) use 128-bit IDs that this 64-bit index does not cover, so
49+
// uniqueness there is not guaranteed; the persisted identity stays
50+
// uint64 until the Windows semantics design decides otherwise (#389).
4751
index := uint64(data.FileIndexHigh)<<32 | uint64(data.FileIndexLow)
4852
if index == 0 {
4953
return 0, 0, false

‎internal/filetxn/identity_windows_test.go‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,11 @@ func TestDirectoryIdentityWindowsRefusals(t *testing.T) {
7171
t.Fatal("stale lstat reported an identity for the replacement")
7272
}
7373
})
74+
// The Go runtime opts every process into long-path support at startup
75+
// (initLongPathSupport sets the PEB flag on Windows 10 1703 and later),
76+
// and the os package then skips its own \\?\ prefix, so os.MkdirAll and
77+
// syscall.CreateFile resolve long paths the same way regardless of the
78+
// LongPathsEnabled registry value.
7479
t.Run("path longer than MAX_PATH", func(t *testing.T) {
7580
path := t.TempDir()
7681
for len(path) <= 300 {

0 commit comments

Comments
 (0)