openzfs / zfs

OpenZFS on Linux and FreeBSD
https://openzfs.github.io/openzfs-docs
Other
10.43k stars 1.73k forks source link

7ddc1f737 breaks kstat #16447

Open glebius opened 1 month ago

glebius commented 1 month ago

System information

FreeBSD CURRENT as of today zfs-2.2.99-559-FreeBSD_g1147a2797 zfs-kmod-2.2.99-559-FreeBSD_g1147a2797

Describe the problem you're observing

The change 7ddc1f737 did not update empty_dataset_kstats structure. Surprisingly compilers don't object at this and act as if initializer was a sparse one.

On FreeBSD the structure is used to initialize the sysctl tree in kstat_install. First, all fields after new ones or shifted, displaying values of wrong counters. Second, the least 3 entries are uninitialized and kstat_install_named would execute installation of the very last oid 4 times, resulting in an error from sysctl(9):

See this email thread: https://lists.freebsd.org/archives/freebsd-current/2024-August/006285.html

Describe how to reproduce the problem

Update to most recent OpenZFS.

robn commented 1 month ago

Fixed by #16431.

behlendorf commented 1 month ago

Merged https://github.com/openzfs/zfs/pull/16431 to master.