From 93ec43ea67413460944176da229647df54d3e9b8 Mon Sep 17 00:00:00 2001 From: Santiago Gimeno Date: Sun, 7 Dec 2025 22:40:22 +0100 Subject: [PATCH] linux: fix uv_fs_ftruncate io_uring implementation (#4963 2/2) The `offset` field should be assigned to ithe `io_uring_sqe.off` field. --- src/unix/linux.c | 2 +- test/test-fs.c | 2 +- test/test-list.h | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/unix/linux.c b/src/unix/linux.c index 17c73663e..5beb4d2cc 100644 --- a/src/unix/linux.c +++ b/src/unix/linux.c @@ -875,7 +875,7 @@ int uv__iou_fs_ftruncate(uv_loop_t* loop, uv_fs_t* req) { return 0; sqe->fd = req->file; - sqe->len = req->off; + sqe->off = req->off; sqe->opcode = UV__IORING_OP_FTRUNCATE; uv__iou_submit(iou); diff --git a/test/test-fs.c b/test/test-fs.c index 4ce059c39..020ee28d6 100644 --- a/test/test-fs.c +++ b/test/test-fs.c @@ -953,7 +953,7 @@ static void lutime_cb(uv_fs_t* req) { } -TEST_IMPL(fs_file_async) { +TEST_FS_IMPL(fs_file_async) { int r; /* Setup. */ diff --git a/test/test-list.h b/test/test-list.h index 954eff330..5d44fefb4 100644 --- a/test/test-list.h +++ b/test/test-list.h @@ -357,7 +357,7 @@ TEST_DECLARE (kill_invalid_signum) TEST_DECLARE (fs_file_noent) TEST_DECLARE (fs_file_nametoolong) TEST_DECLARE (fs_file_loop) -TEST_DECLARE (fs_file_async) +TEST_FS_DECLARE(fs_file_async) TEST_DECLARE (fs_file_sync) TEST_DECLARE (fs_posix_delete) TEST_DECLARE (fs_file_write_null_buffer) @@ -1081,7 +1081,7 @@ TASK_LIST_START TEST_ENTRY (fs_file_noent) TEST_ENTRY (fs_file_nametoolong) TEST_ENTRY (fs_file_loop) - TEST_ENTRY (fs_file_async) + TEST_FS_ENTRY(fs_file_async) TEST_ENTRY (fs_file_sync) TEST_ENTRY (fs_posix_delete) TEST_ENTRY (fs_file_write_null_buffer)