]> granicus.if.org Git - zfs/commitdiff
Fix panic on DilOS with kstat per dataset statistics
authorIgor K <igor@dilos.org>
Tue, 3 Sep 2019 19:12:31 +0000 (22:12 +0300)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 3 Sep 2019 19:12:31 +0000 (12:12 -0700)
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

module/zfs/dataset_kstats.c

index 522825c42ccfbb2c7e0b2c3b9bc6fa3f92f48e53..e46a0926d557e95f1982a36dfc53b07afc76a348 100644 (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;