diff --git a/.github/workflows/build-and-test-latest-kernel.yml b/.github/workflows/build-and-test-latest-kernel.yml index 076000aa..4a3ce044 100644 --- a/.github/workflows/build-and-test-latest-kernel.yml +++ b/.github/workflows/build-and-test-latest-kernel.yml @@ -13,7 +13,7 @@ on: - "**.md" env: - KERNEL_ARCHIVE_URL: "https://cdn.kernel.org/pub/linux/kernel/v7.x/linux-7.0.3.tar.xz" + KERNEL_ARCHIVE_URL: "https://cdn.kernel.org/pub/linux/kernel/v7.x/linux-7.1.2.tar.xz" jobs: build-and-test: diff --git a/include/condy/provided_buffers.hpp b/include/condy/provided_buffers.hpp index 9622417f..16f55933 100644 --- a/include/condy/provided_buffers.hpp +++ b/include/condy/provided_buffers.hpp @@ -153,14 +153,6 @@ class BundledProvidedBufferQueue { .num_buffers = 0, }; -#if !IO_URING_CHECK_VERSION(2, 8) // >= 2.8 - if (flags & IORING_CQE_F_BUF_MORE) { - assert(buf_lens_[result.bid] > static_cast(res)); - buf_lens_[result.bid] -= res; - return result; - } -#endif - bool is_incr = false; #if !IO_URING_CHECK_VERSION(2, 8) // >= 2.8 is_incr = br_flags_ & IOU_PBUF_RING_INC; @@ -335,19 +327,6 @@ class BundledProvidedBufferPool { assert(res > 0); - uint16_t bid = flags >> IORING_CQE_BUFFER_SHIFT; - -#if !IO_URING_CHECK_VERSION(2, 8) // >= 2.8 - if (flags & IORING_CQE_F_BUF_MORE) { - char *data = get_buffer_(bid) + (buffer_size_ - curr_buf_len_); - buffers.emplace_back(data, res, nullptr); - assert(static_cast(res) < curr_buf_len_); - curr_buf_len_ -= res; - return buffers; - } -#endif - assert(bid == curr_io_uring_buf_()->bid); - bool is_incr = false; #if !IO_URING_CHECK_VERSION(2, 8) // >= 2.8 is_incr = br_flags_ & IOU_PBUF_RING_INC; @@ -356,7 +335,7 @@ class BundledProvidedBufferPool { int64_t bytes = res; while (bytes > 0) { auto *buf_ptr = curr_io_uring_buf_(); - bid = buf_ptr->bid; + uint16_t bid = buf_ptr->bid; char *data = get_buffer_(bid) + (buffer_size_ - curr_buf_len_); uint32_t buf_len; diff --git a/tests/test_async_operations.4.cpp b/tests/test_async_operations.4.cpp index 85b2be7a..8e6ef260 100644 --- a/tests/test_async_operations.4.cpp +++ b/tests/test_async_operations.4.cpp @@ -824,50 +824,53 @@ TEST_CASE("test async_operations - test ftruncate - fixed fd") { } #endif -#if !IO_URING_CHECK_VERSION(2, 8) // >= 2.8 -TEST_CASE("test async_operations - test cmd_discard - basic") { - BlkDevice blkdev; - if (blkdev.path().empty()) { - MESSAGE("Can't create loop device, skipping"); - return; - } - - int fd = open(blkdev.path().c_str(), O_RDWR); - REQUIRE(fd >= 0); - - auto func = [&]() -> condy::Coro { - int r = co_await condy::async_cmd_discard(fd, 0, 4096); - REQUIRE(r == 0); - }; - condy::sync_wait(func()); - close(fd); -} -#endif - -#if !IO_URING_CHECK_VERSION(2, 8) // >= 2.8 -TEST_CASE("test async_operations - test cmd_discard - fixed fd") { - BlkDevice blkdev; - if (blkdev.path().empty()) { - MESSAGE("Can't create loop device, skipping"); - return; - } - - int fd = open(blkdev.path().c_str(), O_RDWR); - REQUIRE(fd >= 0); - - auto func = [&]() -> condy::Coro { - auto &fd_table = condy::current_runtime().fd_table(); - fd_table.init(1); - int r = co_await condy::async_files_update(&fd, 1, 0); - REQUIRE(r == 1); - - r = co_await condy::async_cmd_discard(condy::fixed(0), 0, 4096); - REQUIRE(r == 0); - }; - condy::sync_wait(func()); - close(fd); -} -#endif +// TODO: Kernel 7.1 regression, uncomment after fixed +// https://lore.kernel.org/linux-block/20260616155129.406057-1-yi1tang.yang@gmail.com/ +// +// #if !IO_URING_CHECK_VERSION(2, 8) // >= 2.8 +// TEST_CASE("test async_operations - test cmd_discard - basic") { +// BlkDevice blkdev; +// if (blkdev.path().empty()) { +// MESSAGE("Can't create loop device, skipping"); +// return; +// } + +// int fd = open(blkdev.path().c_str(), O_RDWR); +// REQUIRE(fd >= 0); + +// auto func = [&]() -> condy::Coro { +// int r = co_await condy::async_cmd_discard(fd, 0, 4096); +// REQUIRE(r == 0); +// }; +// condy::sync_wait(func()); +// close(fd); +// } +// #endif + +// #if !IO_URING_CHECK_VERSION(2, 8) // >= 2.8 +// TEST_CASE("test async_operations - test cmd_discard - fixed fd") { +// BlkDevice blkdev; +// if (blkdev.path().empty()) { +// MESSAGE("Can't create loop device, skipping"); +// return; +// } + +// int fd = open(blkdev.path().c_str(), O_RDWR); +// REQUIRE(fd >= 0); + +// auto func = [&]() -> condy::Coro { +// auto &fd_table = condy::current_runtime().fd_table(); +// fd_table.init(1); +// int r = co_await condy::async_files_update(&fd, 1, 0); +// REQUIRE(r == 1); + +// r = co_await condy::async_cmd_discard(condy::fixed(0), 0, 4096); +// REQUIRE(r == 0); +// }; +// condy::sync_wait(func()); +// close(fd); +// } +// #endif #if !IO_URING_CHECK_VERSION(2, 7) // >= 2.7 TEST_CASE("test async_operations - test bind - basic") {