]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
libcephfs_proxy: fully initialize async I/O structure 62783/head
authorXavi Hernandez <xhernandez@gmail.com>
Fri, 11 Apr 2025 14:15:05 +0000 (16:15 +0200)
committerXavi Hernandez <xhernandez@gmail.com>
Mon, 14 Apr 2025 09:07:28 +0000 (11:07 +0200)
The ceph_ll_io_info structure has recently been extended to support
zerocopy operations. The proxy was initializing just the known members,
so, after the zerocopy support, it was passing garbage in some fields,
causing failures.

This patch completely clears the whole structure to be sure that
everything is initialized to its default value.

Signed-off-by: Xavi Hernandez <xhernandez@gmail.com>
src/libcephfs_proxy/libcephfsd.c

index b48e88b338b83341a9f5a5ce1ab7e5a2ad9bf68f..a5d9d47e95189370bb3b344b5a10773f2c689e94 100644 (file)
@@ -1558,12 +1558,12 @@ static int32_t libcephfsd_ll_nonblocking_rw(proxy_client_t *client,
        }
        io_info = &async_io->io_info;
 
+       memset(io_info, 0, sizeof(struct ceph_ll_io_info));
        io_info->callback = libcephfsd_ll_nonblocking_rw_cbk;
        io_info->priv = (void *)(uintptr_t)req->ll_nonblocking_rw.info;
        io_info->iov = &async_io->iov;
        io_info->iovcnt = 1;
        io_info->off = req->ll_nonblocking_rw.off;
-       io_info->result = 0;
        io_info->write = req->ll_nonblocking_rw.write;
        io_info->fsync = req->ll_nonblocking_rw.fsync;
        io_info->syncdataonly = req->ll_nonblocking_rw.syncdataonly;