Skip to content

Commit

Permalink
Fix panic on DilOS with kstat per dataset statistics
Browse files Browse the repository at this point in the history
Account for ZFS_MAX_DATASET_NAME_LEN in kstat data size.  This value
is ignored in the Linux kstat code but resolves the issue for other
platforms.

Reviewed-by: Serapheim Dimitropoulos <serapheim@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Igor Kozhukhov <igor@dilos.org>
Closes openzfs#9254
Closes openzfs#9151
  • Loading branch information
ikozhukhov authored and tonyhutter committed Dec 23, 2019
1 parent bef229b commit f96e85c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions module/zfs/dataset_kstats.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ dataset_kstats_create(dataset_kstats_t *dk, objset_t *objset)
kstat->ks_data = dk_kstats;
kstat->ks_update = dataset_kstats_update;
kstat->ks_private = dk;
kstat->ks_data_size += ZFS_MAX_DATASET_NAME_LEN;

kstat_install(kstat);
dk->dk_kstats = kstat;
Expand Down

0 comments on commit f96e85c

Please sign in to comment.