Re: [PATCH net-next 1/2] smc: convert to getsockopt_iter
From: Breno Leitao <leitao@debian.org>
Date: 2026-06-08 10:49:19
Also in:
linux-kselftest, linux-rdma, linux-s390, lkml
From: Breno Leitao <leitao@debian.org>
Date: 2026-06-08 10:49:19
Also in:
linux-kselftest, linux-rdma, linux-s390, lkml
On Fri, Jun 05, 2026 at 05:13:25AM -0700, Breno Leitao wrote:
Convert SMC socket's getsockopt implementation to use the new getsockopt_iter callback with sockopt_t. Key changes: - Replace (char __user *optval, int __user *optlen) with sockopt_t *opt - Use opt->optlen for buffer length (input) and returned size (output) - Use copy_to_iter() instead of put_user()/copy_to_user() - Add linux/uio.h for copy_to_iter() SMC is a proxy socket: only the SOL_SMC level is handled locally, while all other levels are forwarded to the underlying CLC (TCP) socket. That socket's getsockopt() still operates on __user buffers, so the pass-through is limited to user-backed iters: optval is reconstructed from iter_out, the original optlen pointer (preserved in sockopt_t) is forwarded, and the length reported by the clcsock is mirrored back into opt->optlen so the core writes the correct value to userspace. Signed-off-by: Breno Leitao <leitao@debian.org>
Damn, this is not building. let me send a fixed version (v2). -- pw-bot: cr