diff --git a/.github/workflows/ci-latest-kernel.yml b/.github/workflows/ci-latest-kernel.yml index bde07374..800e4442 100644 --- a/.github/workflows/ci-latest-kernel.yml +++ b/.github/workflows/ci-latest-kernel.yml @@ -13,7 +13,7 @@ on: - "**.md" env: - KERNEL_ARCHIVE_URL: "https://cdn.kernel.org/pub/linux/kernel/v7.x/linux-7.1.2.tar.xz" + KERNEL_ARCHIVE_URL: "https://cdn.kernel.org/pub/linux/kernel/v7.x/linux-7.1.5.tar.xz" jobs: build-and-test: diff --git a/tests/test_async_operations.4.cpp b/tests/test_async_operations.4.cpp index 9378a740..6cfcc81b 100644 --- a/tests/test_async_operations.4.cpp +++ b/tests/test_async_operations.4.cpp @@ -825,53 +825,50 @@ TEST_CASE("test async_operations - test ftruncate - fixed fd") { } #endif -// TODO: Kernel 7.1 regression, uncomment after fixed -// https://lore.kernel.org/linux-block/20260616155129.406057-1-yi1tang.yang@gmail.com/ -// -// #if CONDY_URING_VERSION_GE(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 CONDY_URING_VERSION_GE(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 CONDY_URING_VERSION_GE(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 CONDY_URING_VERSION_GE(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 CONDY_URING_VERSION_GE(2, 7) // >= 2.7 TEST_CASE("test async_operations - test bind - basic") {