From 4afb617f59be66f5737bb1c14b8f0da578548bde Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Fri, 23 May 2025 21:18:37 +0300 Subject: [PATCH] Also zero-init sqe --- src/client/msgr_receive.cpp | 4 +++- src/client/msgr_send.cpp | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/client/msgr_receive.cpp b/src/client/msgr_receive.cpp index d994443f..9a7b5c82 100644 --- a/src/client/msgr_receive.cpp +++ b/src/client/msgr_receive.cpp @@ -33,10 +33,12 @@ void osd_messenger_t::read_requests() auto iothread = iothreads.size() ? iothreads[peer_fd % iothreads.size()] : NULL; io_uring_sqe sqe_local; ring_data_t data_local; - sqe_local.user_data = (uint64_t)&data_local; io_uring_sqe* sqe = (iothread ? &sqe_local : ringloop->get_sqe()); if (iothread) + { + sqe_local = { .user_data = (uint64_t)&data_local }; data_local = {}; + } if (!sqe) { cl->read_msg.msg_iovlen = 0; diff --git a/src/client/msgr_send.cpp b/src/client/msgr_send.cpp index 302160c3..dc659ba5 100644 --- a/src/client/msgr_send.cpp +++ b/src/client/msgr_send.cpp @@ -194,10 +194,12 @@ bool osd_messenger_t::try_send(osd_client_t *cl) auto iothread = iothreads.size() ? iothreads[peer_fd % iothreads.size()] : NULL; io_uring_sqe sqe_local; ring_data_t data_local; - sqe_local.user_data = (uint64_t)&data_local; io_uring_sqe* sqe = (iothread ? &sqe_local : ringloop->get_sqe()); if (iothread) + { + sqe_local = { .user_data = (uint64_t)&data_local }; data_local = {}; + } if (!sqe) return false; cl->write_msg.msg_iov = cl->send_list.data();