diff options
author | Bernd Schubert <bschubert@ddn.com> | 2025-07-20 14:31:46 +0200 |
---|---|---|
committer | Bernd Schubert <bernd@bsbernd.com> | 2025-07-22 14:47:12 +0200 |
commit | 062465063500e042723a24704a6e350907cb8f8c (patch) | |
tree | 309c613772be6edbf94c48cdef6bd96ad333df5a /lib/fuse_uring.c | |
parent | e1e7b117ede7d78abde3ca13545a2057b4160b50 (diff) | |
download | libfuse-062465063500e042723a24704a6e350907cb8f8c.tar.gz |
fuse-io-uring: Add sanity check for the number of queue entries
fuse-io-uring would create a blocking mount with 0 queue entries,
we need a sanity check for it.
Signed-off-by: Bernd Schubert <bschubert@ddn.com>
Diffstat (limited to 'lib/fuse_uring.c')
-rw-r--r-- | lib/fuse_uring.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/fuse_uring.c b/lib/fuse_uring.c index 8dea7d0..10d3286 100644 --- a/lib/fuse_uring.c +++ b/lib/fuse_uring.c @@ -727,8 +727,13 @@ static int fuse_uring_start_ring_threads(struct fuse_ring_pool *ring) return rc; } -static int fuse_uring_sanity_check(void) +static int fuse_uring_sanity_check(struct fuse_session *se) { + if (se->uring.q_depth == 0) { + fuse_log(FUSE_LOG_ERR, "io-uring queue depth must be > 0\n"); + return -EINVAL; + } + _Static_assert(sizeof(struct fuse_uring_cmd_req) <= FUSE_URING_MAX_SQE128_CMD_DATA, "SQE128_CMD_DATA has 80B cmd data"); @@ -741,7 +746,7 @@ int fuse_uring_start(struct fuse_session *se) int err = 0; struct fuse_ring_pool *fuse_ring; - fuse_uring_sanity_check(); + fuse_uring_sanity_check(se); fuse_ring = fuse_create_ring(se); if (fuse_ring == NULL) { |