]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
zfs: Fix SPA sysctl handlers
authorMark Johnston <markj@FreeBSD.org>
Mon, 1 Jan 2024 18:54:15 +0000 (13:54 -0500)
committerMark Johnston <markj@FreeBSD.org>
Mon, 1 Jan 2024 18:59:03 +0000 (13:59 -0500)
commit09af4bf2c987f6f57804162cef8aeee05575ad1d
treeebb59a0a266a44818616722ba46313bbe0b001cd
parent499e84e16f56013e24fb69ae8ecfe75180e8d704
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
sys/contrib/openzfs/module/zfs/spa.c