Repository navigation
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #49 +/- ##
==========================================
+ Coverage 96.37% 96.55% +0.18%
==========================================
Files 11 11
Lines 662 697 +35
==========================================
+ Hits 638 673 +35
Misses 24 24
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
al8n
added a commit
that referenced
this pull request
Apr 22, 2026
) Patch release against v1.0.0. No public API changes; four bug fixes plus docs. - **Sparse-file `allocate` (Unix, sync + async)** — the short-circuit on `metadata().len() >= len` silently turned `allocate` into a no-op on sparse files (logical length large, zero blocks reserved). Now gated on `metadata().blocks() * 512 >= len`, which asks the right question ("are the blocks already reserved?") and still skips the macOS `F_PREALLOCATE` re-allocate-ENOSPC path from #15. - **Windows `statvfs`** — `GetDiskFreeSpaceExW` returns three distinct numbers. The previous code passed NULL for the third pointer, reused `lpFreeBytesAvailable` as both `free_space` and `available_space`, and let `total_space` come from the caller-scoped quota total. Now routes `lpTotalNumberOfFreeBytes` → `free_space` (volume-wide, quota-independent), `lpFreeBytesAvailable` → `available_space` (caller quota), and computes `total_space` from cluster math (`sectors_per_cluster * bytes_per_sector * total_number_of_clusters`) so it reports volume capacity. Visibly changes values on quota-enabled volumes. - **Fuchsia build** — `target_os = "fuchsia"` added to the Unix fallocate branch (sync + async). Fuchsia is `cfg(unix)` under rustc and `rustix` exposes `fallocate` there, so the previous omission left Fuchsia builds without an `allocate` symbol once `FileExt` was enabled. With this fix, every fs4 feature builds on Fuchsia **except** `fs-err3` / `fs-err3-tokio`; those remain blocked on upstream `fs-err v3` referencing `std::os::unix::fs::chroot`, which rustc gates out on Fuchsia. Tracking: andrewhickman/fs-err#90. - **Docs** — README gains a **Minimum Supported Rust Version** section (the declared `rust-version = "1.75.0"` covers the default `sync` feature; `async-std` / `smol` effectively require 1.85 via transitive `async-lock` / `async-signal`) and a **Platform Notes → Fuchsia** subsection documenting the upstream `fs-err` gap. New Linux-gated regression test `allocate_reserves_blocks_on_sparse_file` (sync + async): creates a sparse file via `set_len`, asserts `allocated_size == 0`, calls `allocate`, asserts blocks are reserved.
al8n
added a commit
that referenced
this pull request
Apr 23, 2026
) Patch release against v1.0.0. No public API changes; four bug fixes plus docs. - **Sparse-file `allocate` (Unix, sync + async)** — the short-circuit on `metadata().len() >= len` silently turned `allocate` into a no-op on sparse files (logical length large, zero blocks reserved). Now gated on `metadata().blocks() * 512 >= len`, which asks the right question ("are the blocks already reserved?") and still skips the macOS `F_PREALLOCATE` re-allocate-ENOSPC path from #15. - **Windows `statvfs`** — `GetDiskFreeSpaceExW` returns three distinct numbers. The previous code passed NULL for the third pointer, reused `lpFreeBytesAvailable` as both `free_space` and `available_space`, and let `total_space` come from the caller-scoped quota total. Now routes `lpTotalNumberOfFreeBytes` → `free_space` (volume-wide, quota-independent), `lpFreeBytesAvailable` → `available_space` (caller quota), and computes `total_space` from cluster math (`sectors_per_cluster * bytes_per_sector * total_number_of_clusters`) so it reports volume capacity. Visibly changes values on quota-enabled volumes. - **Fuchsia build** — `target_os = "fuchsia"` added to the Unix fallocate branch (sync + async). Fuchsia is `cfg(unix)` under rustc and `rustix` exposes `fallocate` there, so the previous omission left Fuchsia builds without an `allocate` symbol once `FileExt` was enabled. With this fix, every fs4 feature builds on Fuchsia **except** `fs-err3` / `fs-err3-tokio`; those remain blocked on upstream `fs-err v3` referencing `std::os::unix::fs::chroot`, which rustc gates out on Fuchsia. Tracking: andrewhickman/fs-err#90. - **Docs** — README gains a **Minimum Supported Rust Version** section (the declared `rust-version = "1.75.0"` covers the default `sync` feature; `async-std` / `smol` effectively require 1.85 via transitive `async-lock` / `async-signal`) and a **Platform Notes → Fuchsia** subsection documenting the upstream `fs-err` gap. New Linux-gated regression test `allocate_reserves_blocks_on_sparse_file` (sync + async): creates a sparse file via `set_len`, asserts `allocated_size == 0`, calls `allocate`, asserts blocks are reserved.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Patch release against v1.0.0. No public API changes; four bug fixes plus docs.
allocate(Unix, sync + async) — the short-circuit onmetadata().len() >= lensilently turnedallocateinto a no-op on sparse files (logical length large, zero blocks reserved). Now gated onmetadata().blocks() * 512 >= len, which asks the right question ("are the blocks already reserved?") and still skips the macOSF_PREALLOCATEre-allocate-ENOSPC path from Allocation on macOS is not working, while it does with fs2 #15.statvfs—GetDiskFreeSpaceExWreturns three distinct numbers. The previous code passed NULL for the third pointer, reusedlpFreeBytesAvailableas bothfree_spaceandavailable_space, and lettotal_spacecome from the caller-scoped quota total. Now routeslpTotalNumberOfFreeBytes→free_space(volume-wide, quota-independent),lpFreeBytesAvailable→available_space(caller quota), and computestotal_spacefrom cluster math (sectors_per_cluster * bytes_per_sector * total_number_of_clusters) so it reports volume capacity. Visibly changes values on quota-enabled volumes.target_os = "fuchsia"added to the Unix fallocate branch (sync + async). Fuchsia iscfg(unix)under rustc andrustixexposesfallocatethere, so the previous omission left Fuchsia builds without anallocatesymbol onceFileExtwas enabled. With this fix, every fs4 feature builds on Fuchsia exceptfs-err3/fs-err3-tokio; those remain blocked on upstreamfs-err v3referencingstd::os::unix::fs::chroot, which rustc gates out on Fuchsia. Tracking: fs-err 3.x fails to compile on target_os = "fuchsia" (chroot gated out) andrewhickman/fs-err#90.rust-version = "1.75.0"covers the defaultsyncfeature;async-std/smoleffectively require 1.85 via transitiveasync-lock/async-signal) and a Platform Notes → Fuchsia subsection documenting the upstreamfs-errgap.Testing
New Linux-gated regression test
allocate_reserves_blocks_on_sparse_file(sync + async): creates a sparse file viaset_len, assertsallocated_size == 0, callsallocate, asserts blocks are reserved.Semver
Patch. No public API added, removed, or altered. The Windows
statvfsfix changes observable numeric values on quota-enabled volumes, but the previous values were documented-incorrect.Test plan
cargo test --all-featureson ubuntu, macos, windows via CIcargo hack clippy --each-featuregreen on all CI OSesx86_64-unknown-fuchsiaonce CI is extended (new target worth adding)free_space/total_spacevalues on a Windows volume with a user quota configured