Skip to content

Commit fd469b7

Browse files
committed
selftests/fuse: add FUSE io-uring integration test
jira SECO-478 RFE: FUSE_IO_URING Add a kselftest for the FUSE io-uring request dispatch path. A minimal in-memory FUSE daemon runs in a thread, negotiates FUSE_OVER_IO_URING during FUSE_INIT, and handles requests through FUSE_IO_URING_CMD_REGISTER / FUSE_IO_URING_CMD_COMMIT_AND_FETCH. An atomic counter verifies requests are served through io_uring. Test cases: - read_file: read and verify file content - write_and_readback: write data, read it back, compare - readdir: list directory, verify entries - stat_files: stat root and file, verify attributes - concurrent_io: 4 threads doing interleaved reads and writes - requests_via_uring: per-operation verification that read, write, readdir, and stat each produce io_uring requests - sustained_io: write 256KB in 4KB chunks, read back, verify pattern - crash_recovery: fork daemon, SIGKILL with active I/O, verify kernel health - abort_before_ring_ready: negotiate io_uring but never register entries, abort connection, verify no deadlock or leak Tests SKIP when prerequisites are not met (no root, io_uring disabled, enable_uring != Y). Signed-off-by: Brett Mastbergen <bmastbergen@ciq.com>
1 parent 30bbef4 commit fd469b7

4 files changed

Lines changed: 1458 additions & 0 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
# SPDX-License-Identifier: GPL-2.0-only
22
fuse_mnt
3+
fuse_uring_test
34
fusectl_test

tools/testing/selftests/filesystems/fuse/Makefile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@ CFLAGS += -Wall -O2 -g $(KHDR_INCLUDES)
55
TEST_GEN_PROGS := fusectl_test
66
TEST_GEN_FILES := fuse_mnt
77

8+
# fuse_uring_test requires liburing; add it only when the library is present.
9+
URING_CFLAGS := $(shell pkg-config liburing --cflags 2>/dev/null)
10+
URING_LDLIBS := $(shell pkg-config liburing --libs 2>/dev/null)
11+
ifeq ($(URING_LDLIBS),)
12+
$(warning liburing not found; fuse_uring_test will be skipped)
13+
else
14+
TEST_GEN_PROGS += fuse_uring_test
15+
endif
16+
817
# fuse_acl_cache_test requires libfuse3; add it only when the library is present.
918
ACL_CFLAGS := $(shell pkg-config fuse3 --cflags 2>/dev/null)
1019
ACL_LDLIBS := $(shell pkg-config fuse3 --libs 2>/dev/null)
@@ -36,3 +45,6 @@ $(OUTPUT)/fuse_mnt: LDLIBS += $(VAR_LDLIBS)
3645

3746
$(OUTPUT)/fuse_acl_cache_test: CFLAGS += $(ACL_CFLAGS)
3847
$(OUTPUT)/fuse_acl_cache_test: LDLIBS += $(ACL_LDLIBS)
48+
49+
$(OUTPUT)/fuse_uring_test: CFLAGS += $(URING_CFLAGS) -Wextra -Wno-unused-parameter -pthread
50+
$(OUTPUT)/fuse_uring_test: LDLIBS += $(URING_LDLIBS) -lpthread
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
CONFIG_FUSE_FS=m
2+
CONFIG_FUSE_IO_URING=y
3+
CONFIG_IO_URING=y

0 commit comments

Comments
 (0)