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 16 2024, 7:32 PM
Parents
rG3bd23fd78dce: freebsd: fix compile for spa_taskq_read/spa_taskq_write params
Branches
Unknown
Tags
Unknown