aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBernd Schubert <bschubert@ddn.com>2025-06-16 15:28:26 +0200
committerBernd Schubert <bernd@bsbernd.com>2025-06-17 19:23:36 +0200
commitf4c5d20772145c02f8e78176ae9d6cb6f60c6cfa (patch)
tree86c3f3be7c8ec84fcd7d7e4526a145dc5ef8b29c
parent410890482c8b134525bb9f006089848399eea62a (diff)
downloadlibfuse-f4c5d20772145c02f8e78176ae9d6cb6f60c6cfa.tar.gz
Fix io-uring teardown
We need to write an uint64_t to eventfd. Signed-off-by: Bernd Schubert <bschubert@ddn.com>
-rw-r--r--lib/fuse_uring.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/fuse_uring.c b/lib/fuse_uring.c
index fb5cd8f..33f8f56 100644
--- a/lib/fuse_uring.c
+++ b/lib/fuse_uring.c
@@ -345,9 +345,15 @@ static void fuse_session_destruct_uring(struct fuse_ring_pool *fuse_ring)
fuse_uring_get_queue(fuse_ring, qid);
if (queue->tid != 0) {
- int value = 1;
-
- write(queue->eventfd, &value, sizeof(value));
+ uint64_t value = 1ULL;
+ int rc;
+
+ rc = write(queue->eventfd, &value, sizeof(value));
+ if (rc != sizeof(value))
+ fprintf(stderr,
+ "Wrote to eventfd=%d err=%s: rc=%d\n",
+ queue->eventfd, strerror(errno), rc);
+ pthread_cancel(queue->tid);
pthread_join(queue->tid, NULL);
queue->tid = 0;
}
@@ -416,7 +422,7 @@ static int fuse_uring_prepare_fetch_sqes(struct fuse_ring_queue *queue)
return -EINVAL;
}
- // Add the poll SQE for the eventfd to wake up on teardown
+ /* Poll SQE for the eventfd to wake up on teardown */
sqe = io_uring_get_sqe(&queue->ring);
if (sqe == NULL) {
fuse_log(FUSE_LOG_ERR, "Failed to get eventfd SQE");