From 9947ebd5e0a4a915fbb7c56d59e5e7f8061e4748 Mon Sep 17 00:00:00 2001 From: Jorgen Lundman Date: Fri, 6 Dec 2024 19:32:03 +0900 Subject: [PATCH] param_set_arc_int used u64 and did nothing Change param_set_arc_int to use U32 as expected, and actually set the tunable destination when changed. Signed-off-by: Jorgen Lundman --- module/os/windows/zfs/sysctl_os.c | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/module/os/windows/zfs/sysctl_os.c b/module/os/windows/zfs/sysctl_os.c index af0f7d04db6e..9aedde2eab54 100644 --- a/module/os/windows/zfs/sysctl_os.c +++ b/module/os/windows/zfs/sysctl_os.c @@ -547,10 +547,19 @@ sysctl_vfs_zfs_arc_no_grow_shift(ZFS_MODULE_PARAM_ARGS) int param_set_arc_u64(ZFS_MODULE_PARAM_ARGS) { - *ptr = zt->zt_ptr; + uint64_t val; + *len = sizeof (uint64_t); *type = ZT_TYPE_U64; + if (set == B_FALSE) { + *ptr = zt->zt_ptr; + return (0); + } + + val = *(uint64_t *)(*ptr); + *((uint64_t *)zt->zt_ptr) = val; + arc_tuning_update(B_TRUE); return (0); @@ -559,9 +568,18 @@ param_set_arc_u64(ZFS_MODULE_PARAM_ARGS) int param_set_arc_int(ZFS_MODULE_PARAM_ARGS) { - *ptr = zt->zt_ptr; - *len = sizeof (uint64_t); - *type = ZT_TYPE_U64; + int val; + + *len = sizeof (uint32_t); + *type = ZT_TYPE_UINT; + + if (set == B_FALSE) { + *ptr = zt->zt_ptr; + return (0); + } + + val = *(uint32_t *)(*ptr); + *((uint32_t *)zt->zt_ptr) = val; arc_tuning_update(B_TRUE);