HomeFreeBSD

spa: Fix FreeBSD sysctl handlers

Description

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

Details

Provenance
markjAuthored on Dec 29 2023, 3:22 PM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on Jan 12 2024, 8:24 PM
Parents
rG6138af86b317: Stop wasting time on malloc in snprintf_zstd_header
Branches
Unknown
Tags
Unknown