fix #6640, #6938: api: disks: zfs: return exact error counters

Without '-p', 'zpool status' shortens the READ, WRITE and CKSUM counters
of a vdev to a value with a unit suffix once they reach 1024, for
example 1130 read errors are shown as '1.10K'. The parser just adds
zero to those values, so the API returned 1.1 read errors in that case
and logged a warning like:

  Argument "1.10K" isn't numeric in addition (+)

Request exact values with '-p'. For the non-JSON output of 'zpool
status' it only affects those counters, the sizes in the scan line stay
human readable.

Signed-off-by: Michal Fox <me@dualfroz.com>
This commit is contained in:
dualfroz committed 2026-10-02 16:15:39 +02:00
1 parent e47d23f3c7
commit 6320a3a111
2 files changed
+79 -2

No files matched your search

+1 -1
View File
@@ -217,7 +217,7 @@ __PACKAGE__->register_method({
die "zfsutils-linux not installed\n";
}
my $cmd = [$ZPOOL, 'status', '-P', $param->{name}];
my $cmd = [$ZPOOL, 'status', '-P', '-p', $param->{name}];
my $pool = {
lvl => 0,