HomeFreeBSD

zfs: Fix SPA sysctl handlers

Description

zfs: Fix SPA sysctl handlers

sbuf_cpy() resets the sbuf state, which is wrong for sbufs allocated by
sbuf_new_for_sysctl(). In particular, this code triggers an assertion
failure in sbuf_clear().

Simplify by just using sysctl_handle_string() for both reading and
setting the tunable.

Apply to FreeBSD directly since this bug causes "sysctl -a" to crash the
kernel.

PR: 276039
Reported by: pho
Reviewed by: mav
Pull Request: https://github.com/openzfs/zfs/pull/15719

Details

Provenance
markjAuthored on Jan 1 2024, 6:54 PM
Parents
rG499e84e16f56: copyright: Bump the copyright date.
Branches
Unknown
Tags
Unknown