fs: expose frsize field in statfs#62277
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #62277 +/- ##
==========================================
- Coverage 89.71% 89.71% -0.01%
==========================================
Files 694 694
Lines 214216 214218 +2
Branches 41114 41115 +1
==========================================
+ Hits 192176 192177 +1
+ Misses 14106 14105 -1
- Partials 7934 7936 +2
🚀 New features to boost your workflow:
|
|
Hi, All "with shared libraries" CI jobs fail with:
These jobs build with Should we wait for the nixpkgs libuv update? |
e2fcd59 to
7707513
Compare
Expose `f_frsize` from libuv's `uv_statfs_t` as `statfs.frsize`. Per POSIX, `f_blocks`, `f_bfree`, and `f_bavail` are expressed in units of `f_frsize`, not `f_bsize`. On most filesystems the two values are typically equal, but some filesystem drivers report a different `f_bsize`, making it impossible to compute accurate disk usage without `frsize`. Refs: libuv/libuv#4983
7707513 to
c3a761a
Compare
|
Hi, just a quick update on this. The shared libraries CI issue should now be resolved:
I've rebased on main. The shared libraries CI should pass now. |
|
The remaining CI failure |
|
Landed in f8ee196 |
Expose `f_frsize` from libuv's `uv_statfs_t` as `statfs.frsize`. Per POSIX, `f_blocks`, `f_bfree`, and `f_bavail` are expressed in units of `f_frsize`, not `f_bsize`. On most filesystems the two values are typically equal, but some filesystem drivers report a different `f_bsize`, making it impossible to compute accurate disk usage without `frsize`. Refs: libuv/libuv#4983 PR-URL: nodejs#62277 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Juan José Arboleda <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Gürgün Dayıoğlu <[email protected]>
Expose `f_frsize` from libuv's `uv_statfs_t` as `statfs.frsize`. Per POSIX, `f_blocks`, `f_bfree`, and `f_bavail` are expressed in units of `f_frsize`, not `f_bsize`. On most filesystems the two values are typically equal, but some filesystem drivers report a different `f_bsize`, making it impossible to compute accurate disk usage without `frsize`. Refs: libuv/libuv#4983 PR-URL: #62277 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Juan José Arboleda <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Gürgün Dayıoğlu <[email protected]>
Notable changes: buffer: * (SEMVER-MINOR) add `end` parameter (Robert Nagy) #62390 crypto: * (SEMVER-MINOR) accept key data in `crypto.diffieHellman()` and cleanup DH jobs (Filip Skokan) #62527 * (SEMVER-MINOR) implement `randomUUIDv7()` (nabeel378) #62553 debugger: * (SEMVER-MINOR) add edit-free runtime expression probes to `node inspect` (Joyee Cheung) #62713 fs: * (SEMVER-MINOR) add `signal` option to `fs.stat()` (Mert Can Altin) #57775 * (SEMVER-MINOR) expose frsize field in statfs (Jinho Jang) #62277 http: * (SEMVER-MINOR) harden `ClientRequest` options merge (Matteo Collina) #63082 * (SEMVER-MINOR) add `req.signal` to `IncomingMessage` (Akshat) #62541 lib,src,test,doc: * (SEMVER-MINOR) add `node:ffi` module (Colin Ihrig) #62072 process: * (SEMVER-MINOR) throw on `execve(2)` failure instead of aborting (Bryan English) #62878 src: * (SEMVER-MINOR) allow empty `--experimental-config-file` (Marco Ippolito) #61610 stream: * (SEMVER-MINOR) propagate destruction in `duplexPair` (Ahmed Elhor) #61098 test_runner: * (SEMVER-MINOR) align mock timeout api (sangwook) #62820 * (SEMVER-MINOR) add mock-timers support for `AbortSignal.timeout` (DeveloperViraj) #60751 * (SEMVER-MINOR) support test order randomization (Pietro Marchini) #61747 util: * (SEMVER-MINOR) colorize text with hex colors (Guilherme Araújo) #61556 PR-URL: #63137
Expose
f_frsizefrom libuv'suv_statfs_tasstatfs.frsize.libuv 1.52.0 added
f_frsizetouv_statfs_t, and this dependency update has already landed in Node.js (5bebd7e),so users can now compute accurate disk usage on every filesystem type.
Per POSIX,
f_blocks,f_bfree, andf_bavailare in units off_frsize, notf_bsize. On most filesystems the two values happen to be equal, soblocks * bsizegives a correct result. However, some filesystem drivers report a largerbsizeas the I/O transfer size whilefrsizeremains at the actual block size, producing a significant overestimation.I hit this on a Docker container using virtiofs with a bind-mounted host directory:
blocks × frsizeblocks × bsizeWithout
frsizeexposed, there is no way to work around this using the Node.js API alone.See also libuv/libuv#4983 where the same problem was discussed.