Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 21 Jul 2021 17:42:39 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 257316] kstat.zfs sysctl tree unreachable for pools with "." in the name
Message-ID:  <bug-257316-227@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D257316

            Bug ID: 257316
           Summary: kstat.zfs sysctl tree unreachable for pools with "."
                    in the name
           Product: Base System
           Version: 13.0-RELEASE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Many People
          Priority: ---
         Component: kern
          Assignee: bugs@FreeBSD.org
          Reporter: asomers@FreeBSD.org

FreeBSD exports statistics about pools and datasets via sysctl, in a tree
rooted at "kstat.zfs.<pool_name>".  One problem: "." is a legal character in
pool names but it's the separator for sysctl trees.  When a pool has "." in=
 the
name its stats will still be exported and they can be viewed by iterating
through all of "kstat.zfs".  However, they won't be addressable by pool, and
interpreting the output of "kstat.zfs" is difficult.  For example:

# I have a pool named "foo.bar"
$ zpool list
NAME       SIZE  ALLOC   FREE  CKPOINT  EXPANDSZ   FRAG    CAP  DEDUP    HE=
ALTH
 ALTROOT
foo.bar   9.50G   720K  9.50G        -         -     0%     0%  1.00x    ON=
LINE
 -
testpool  9.50G  1.45M  9.50G        -         -     0%     0%  1.00x    ON=
LINE
 -

# Its statistics are exported
$ sysctl kstat.zfs | grep foo.bar.dataset
kstat.zfs.foo.bar.dataset.objset-0x36.nunlinked: 0
kstat.zfs.foo.bar.dataset.objset-0x36.nunlinks: 0
kstat.zfs.foo.bar.dataset.objset-0x36.nread: 0
kstat.zfs.foo.bar.dataset.objset-0x36.reads: 0
kstat.zfs.foo.bar.dataset.objset-0x36.nwritten: 0
kstat.zfs.foo.bar.dataset.objset-0x36.writes: 0
kstat.zfs.foo.bar.dataset.objset-0x36.dataset_name: foo.bar

# But they aren't individually addressable
$ sysctl kstat.zfs.foo.bar
sysctl: unknown oid 'kstat.zfs.foo.bar'
$ sysctl kstat.zfs.foo
sysctl: unknown oid 'kstat.zfs.foo'

I think a proper solution would involve some kind of escaping of the "."
character in the name.

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-257316-227>