[Bug 274878] ZFS: Corruption in sysctl "kstat.zfs.POOLNAME.dataset.objset-0xXXXX.dataset_name"

From: <bugzilla-noreply_at_freebsd.org>
Date: Thu, 02 Nov 2023 17:10:55 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=274878

            Bug ID: 274878
           Summary: ZFS: Corruption in sysctl
                    "kstat.zfs.POOLNAME.dataset.objset-0xXXXX.dataset_name
                    "
           Product: Base System
           Version: 13.2-RELEASE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: kern
          Assignee: bugs@FreeBSD.org
          Reporter: asomers@FreeBSD.org

The kstat.zfs.<POOLNAME>.dataset.objset-0x<OBJID> sysctl nodes publish
statistics about ZFS datasets, such as throughput.  The "dataset_name" node is
supposed to contain the name of the ZFS dataset.  But on both FreeBSD 13.1 and
13.2 I am seeing some dataset_name nodes that are corrupted.  They contain the
name of one dataset suffixed by part of the name of another.  For example,
sysctl shows a node named:

kstat.zfs.MYPOOL.dataset.objset-0x1982c.dataset_name:
MYPOOL/MYDS/transfer/273/0

But no such dataset is present.  Instead, that name seems to be synthesized by
a combination of the following dataset names:

NAME                   OBJSETID
MYPOOL/MYDS/273/0      104492
MYPOOL/MYDS/transfer   17007

One possible cause, which I haven't verified, would be ZFS renames.  It may be
that "zfs rename MYPOOL/MYDS/transfer/273/0 MYPOOL/MYDS/273/0" doesn't update
the value of that sysctl node.

This bug is most apparent when using sysutils/ztop.

-- 
You are receiving this mail because:
You are the assignee for the bug.