VFS: clamp S:\ free and total bytes to config.pls_mb in GetDiskFreeSpaceEx (#106) #243

Closed
github-bot wants to merge 1 commit from gh-pr/243/head into gh-pr/243/base
Owner

@⁠slopgobblercobbler on GitHub · 2026-11-23 21:46 UTC · original
slopgobblercobbler:fix/pls-quota-clamp → main · +193 −9 · 1 files · 1 commits · closed without merging

Addresses #106 Item 4 (S:\ PLS disk space quota):
In GetDiskFreeSpaceExW and GetDiskFreeSpaceExA, clamp persistent local storage (S:\) free, total, and available bytes to config.pls_mb (or the default 4096 MiB) instead of reporting the unconstrained host NVMe volume size.

What is in it

  • crates/xcl/src/vfs_hooks.rs:
    • is_pls_path() recognizes S:\, s:/, \\?\S:, and subdirectories case-insensitively.
    • clamp_pls_space() caps total and free bytes to the PLS quota without precision loss when host free space is smaller.
    • Leaves non-PLS volumes (G:\, T:\, C:\, etc.) completely unchanged.
    • Safely checks for null pointer PULARGE_INTEGER out-parameters.
    • Unit tests: disk_free_space_ex_clamps_pls_and_preserves_non_pls covering path variations, quota capping, subpaths, and passthrough.

Tested

  • cargo test -p xcl -- vfs (19 passed, 0 failed).
  • Full workspace test suite: cargo test --workspace (603 passed, 0 failed).
  • Windows 11 x64, MSVC toolchain.

Not tested

  • Custom configured PLS drive letters beyond standard console mappings.

AI use

  • Developed with Antigravity swarm coordinator & dedicated author/verifier agents (author-pls, verify-pls). Verified and reviewed independently.
**@⁠slopgobblercobbler** on GitHub · 2026-11-23 21:46 UTC · [original](https://github.com/xcl-dev/xcl/pull/243) `slopgobblercobbler:fix/pls-quota-clamp` → `main` · +193 −9 · 1 files · 1 commits · closed without merging Addresses #106 Item 4 (S:\ PLS disk space quota): In `GetDiskFreeSpaceExW` and `GetDiskFreeSpaceExA`, clamp persistent local storage (`S:\`) free, total, and available bytes to `config.pls_mb` (or the default 4096 MiB) instead of reporting the unconstrained host NVMe volume size. **What is in it** - `crates/xcl/src/vfs_hooks.rs`: - `is_pls_path()` recognizes `S:\`, `s:/`, `\\?\S:`, and subdirectories case-insensitively. - `clamp_pls_space()` caps total and free bytes to the PLS quota without precision loss when host free space is smaller. - Leaves non-PLS volumes (`G:\`, `T:\`, `C:\`, etc.) completely unchanged. - Safely checks for null pointer `PULARGE_INTEGER` out-parameters. - Unit tests: `disk_free_space_ex_clamps_pls_and_preserves_non_pls` covering path variations, quota capping, subpaths, and passthrough. **Tested** - `cargo test -p xcl -- vfs` (19 passed, 0 failed). - Full workspace test suite: `cargo test --workspace` (603 passed, 0 failed). - Windows 11 x64, MSVC toolchain. **Not tested** - Custom configured PLS drive letters beyond standard console mappings. **AI use** - Developed with Antigravity swarm coordinator & dedicated author/verifier agents (`author-pls`, `verify-pls`). Verified and reviewed independently.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:17:16 +00:00
github-bot closed this pull request 2026-11-26 04:17:16 +00:00
Author
Owner

@⁠raylitebull on GitHub · 2026-11-24 10:42 UTC · original

Closing as a duplicate of #231, which has already been merged into main.

**@⁠raylitebull** on GitHub · 2026-11-24 10:42 UTC · [original](https://github.com/xcl-dev/xcl/pull/243#issuecomment-7129139783) Closing as a duplicate of #231, which has already been merged into `main`.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.