Report storage quota errors when save usage cannot be read #123

Merged
feanorsun merged 1 commit from upstream-pr/123 into main 2026-11-26 08:17:50 +00:00
feanorsun commented 2026-11-26 05:09:00 +00:00 (Migrated from github.com)

Imported from avatarmanz/VIctory-7900XTX. Originally posted by feanorsun on 2026-11-26T05:09:00Z.


Refs #30

XSystem previously treated an unreadable storage root as empty and ignored errors while enumerating entries or reading their metadata. A title could therefore receive the full quota in response to a space request even when the runtime could not measure its usage.

The usage walk now propagates the first error, including failures in nested directories. The quota query logs the path and OS error once per failed scan and returns E_FAIL without writing partial space information. A valid async prompt still starts with S_OK. Its final status and result both report E_FAIL when scanning fails, or E_ABORT when a successful scan shows insufficient quota.

First launch creates the storage directory before installing the title. An empty directory still uses zero bytes, and a successful query uses the same quota and host free-space calculations. This addresses item 1. Usage caching (item 2) is left for follow-up.

Windows tests

With the regression assertion added to the original implementation, this exact test failed on a 1,000-byte request against a regular file used as the storage root. The final status and result were both S_OK. The same assertion passes with the change and observes E_FAIL for both.

$regression = 'modules::storage::tests::serves_a_drive_over_the_title_folder_and_its_quota'
cargo test --locked -j 1 -p victory-hle --lib $regression -- --test-threads=1 --exact --list
cargo test --locked -j 1 -p victory-hle --lib $regression -- --test-threads=1 --exact --nocapture

cargo test --locked -j 1 -p victory-hle --lib modules::storage::tests:: -- --test-threads=1 --list
cargo test --locked -j 1 -p victory-hle --lib modules::storage::tests:: -- --test-threads=1 --nocapture

The fixed Windows build listed and ran 5 targeted CPU tests. All 5 passed, with 151 unrelated tests filtered out. The fixtures covered an empty directory, 8 bytes across nested files, a missing root, an exclusively opened subdirectory, and the synchronous and asynchronous quota interfaces. Local verification used temporary storage only. No game, GPU, D3D12, or WARP tests were run.

<!-- greyfinch-sync:avatarmanz/VIctory-7900XTX:issue:6619964219 --> Imported from [avatarmanz/VIctory-7900XTX](https://github.com/avatarmanz/VIctory-7900XTX/pull/123). Originally posted by [feanorsun](https://github.com/feanorsun) on 2026-11-26T05:09:00Z. --- Refs #30 XSystem previously treated an unreadable storage root as empty and ignored errors while enumerating entries or reading their metadata. A title could therefore receive the full quota in response to a space request even when the runtime could not measure its usage. The usage walk now propagates the first error, including failures in nested directories. The quota query logs the path and OS error once per failed scan and returns `E_FAIL` without writing partial space information. A valid async prompt still starts with `S_OK`. Its final status and result both report `E_FAIL` when scanning fails, or `E_ABORT` when a successful scan shows insufficient quota. First launch creates the storage directory before installing the title. An empty directory still uses zero bytes, and a successful query uses the same quota and host free-space calculations. This addresses item 1. Usage caching (item 2) is left for follow-up. ## Windows tests With the regression assertion added to the original implementation, this exact test failed on a 1,000-byte request against a regular file used as the storage root. The final status and result were both `S_OK`. The same assertion passes with the change and observes `E_FAIL` for both. ```powershell $regression = 'modules::storage::tests::serves_a_drive_over_the_title_folder_and_its_quota' cargo test --locked -j 1 -p victory-hle --lib $regression -- --test-threads=1 --exact --list cargo test --locked -j 1 -p victory-hle --lib $regression -- --test-threads=1 --exact --nocapture cargo test --locked -j 1 -p victory-hle --lib modules::storage::tests:: -- --test-threads=1 --list cargo test --locked -j 1 -p victory-hle --lib modules::storage::tests:: -- --test-threads=1 --nocapture ``` The fixed Windows build listed and ran 5 targeted CPU tests. All 5 passed, with 151 unrelated tests filtered out. The fixtures covered an empty directory, 8 bytes across nested files, a missing root, an exclusively opened subdirectory, and the synchronous and asynchronous quota interfaces. Local verification used temporary storage only. No game, GPU, D3D12, or WARP tests were run.
avatarmanz commented 2026-11-26 07:55:35 +00:00 (Migrated from github.com)

Imported from avatarmanz/VIctory-7900XTX. Originally posted by avatarmanz on 2026-11-26T07:55:35Z.


Merged into main in the next push (tests pass); thanks.

<!-- greyfinch-sync:avatarmanz/VIctory-7900XTX:comment:7185986941 --> Imported from [avatarmanz/VIctory-7900XTX](https://github.com/avatarmanz/VIctory-7900XTX/pull/123#issuecomment-7185986941). Originally posted by [avatarmanz](https://github.com/avatarmanz) on 2026-11-26T07:55:35Z. --- Merged into main in the next push (tests pass); thanks.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
avatarmanz/VIctory-7900XTX!123
No description provided.