]> git.proxmox.com Git - mirror_zfs.git/commit
spa: Fix FreeBSD sysctl handlers
authorMark Johnston <markj@FreeBSD.org>
Fri, 29 Dec 2023 15:22:58 +0000 (10:22 -0500)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 12 Jan 2024 20:24:21 +0000 (12:24 -0800)
commit3bddc4daec2a3ebc12cbc9785121765fe187f01e
treea2417f5534d0d92b4bc59b4fee3072b33bc865ca
parent6138af86b317d24f16e1aae71f68ebb5fcb92e46
spa: Fix FreeBSD 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.

Fixes: 6930ecbb7 ("spa: make read/write queues configurable")
Reviewed-by: Rob Norris <robn@despairlabs.com>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Reported-by: Peter Holm <pho@FreeBSD.org>
Signed-off-by: Mark Johnston <markj@FreeBSD.org>
Closes #15719
module/zfs/spa.c