Fix panic on DilOS with kstat per dataset statistics

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 #9254
Closes #9151
This commit is contained in:
Igor K 2019-09-03 22:12:31 +03:00 committed by Tony Hutter
parent 068c5495f0
commit 5cb46afcf1

View File

@ -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;