Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

panic[cpu0]/thread=fffffe0bf4170c20: assertion failed: strbuf <= (char *)kbuf + kbufsize + 1, file: ../../common/io/kstat.c, line: 342 #9151

Closed
ikozhukhov opened this issue Aug 11, 2019 · 2 comments

Comments

@ikozhukhov
Copy link
Contributor

ikozhukhov commented Aug 11, 2019

commit a448a25 introduce panic on DilOS (commit on DilOS tree: https://bitbucket.org/dilos/dilos-illumos/commits/f0076d31d83eec58cbf52997843232cc646bc385)

panic[cpu0]/thread=fffffe0bf4170c20:
assertion failed: strbuf <= (char *)kbuf + kbufsize + 1, file: ../../common/io/kstat.c, line: 342


fffffe0011242530 genunix:process_type+194d7d ()
fffffe0011242c80 kstat:read_kstat_data+8be ()
fffffe0011242cc0 kstat:kstat_ioctl+5b ()
fffffe0011242d00 genunix:cdev_ioctl+25 ()
fffffe0011242d50 specfs:spec_ioctl+4d ()
fffffe0011242de0 genunix:fop_ioctl+55 ()
fffffe0011242ef0 genunix:ioctl+a4 ()
fffffe0011242f00 unix:brand_sys_syscall+320 ()

System information

Type Version/Name
Distribution Name DilOS
Distribution Version
Linux Kernel
Architecture
ZFS Version
SPL Version

Describe the problem you're observing

Describe how to reproduce the problem

ZTS

Include any warning/errors/backtraces from the system logs

proposed fix (tested on DilOS: https://bitbucket.org/dilos/dilos-illumos/commits/217477b0a87c8f778f75bb3ed6f589f696251d13):

igor@z172:~/users/igor/dilos-illumos.zfs$ g show 217477b0a87c8f778f75bb3ed6f589f696251d13
commit 217477b0a87c8f778f75bb3ed6f589f696251d13
Author: Igor Kozhukhov <[email protected]>
Date:   Wed Aug 7 19:49:55 2019 +0300

    update dataset_kstats.c

diff --git a/usr/src/uts/common/fs/zfs/dataset_kstats.c b/usr/src/uts/common/fs/zfs/dataset_kstats.c
index b1f2050df8..239f17df0d 100644
--- a/usr/src/uts/common/fs/zfs/dataset_kstats.c
+++ b/usr/src/uts/common/fs/zfs/dataset_kstats.c
@@ -149,6 +149,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;
@ikozhukhov
Copy link
Contributor Author

@behlendorf @ahrens

@behlendorf
Copy link
Contributor

@ikozhukhov the proposed fix looks reasonable to me. Would you mind opening a PR for it.

tonyhutter pushed a commit to tonyhutter/zfs that referenced this issue Dec 24, 2019
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 <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Igor Kozhukhov <[email protected]>
Closes openzfs#9254
Closes openzfs#9151
tonyhutter pushed a commit to tonyhutter/zfs that referenced this issue Dec 27, 2019
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 <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Igor Kozhukhov <[email protected]>
Closes openzfs#9254
Closes openzfs#9151
tonyhutter pushed a commit that referenced this issue Jan 23, 2020
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 <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Igor Kozhukhov <[email protected]>
Closes #9254
Closes #9151
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants