History

io_uring: allow unbreakable links

Some commands will invariably end in a failure in the sense that the completion result will be less than zero. One such example is timeouts that don't have a completion count set, they will always complete with -ETIME unless cancelled. For linked commands, we sever links and fail the rest of the chain if the result is less than zero. Since we have commands where we know that will happen, add IOSQE_IO_HARDLINK as a stronger link that doesn't sever regardless of the completion result. Note that the link will still sever if we fail submitting the parent request, hard links are only resilient in the presence of completion results for requests that did submit correctly.

Jens Axboe committed 6 years ago

Commit 4e88d6e1 parent 0b4295b2 files · +47 −38Browse files

Showing the changes to include/uapi/linux (1 of 2 files). Show all

Unified · Split

include/uapi/linux/io_uring.h+1−0
@@ -48,6 +48,7 @@ struct io_uring_sqe { · 47 unmodified lines
48#define IOSQE_FIXED_FILE (1U << 0) /* use fixed fileset */48#define IOSQE_FIXED_FILE (1U << 0) /* use fixed fileset */
49#define IOSQE_IO_DRAIN (1U << 1) /* issue after inflight IO */49#define IOSQE_IO_DRAIN (1U << 1) /* issue after inflight IO */
50#define IOSQE_IO_LINK (1U << 2) /* links next sqe */50#define IOSQE_IO_LINK (1U << 2) /* links next sqe */
51#define IOSQE_IO_HARDLINK (1U << 3) /* like LINK, but stronger */
51 52
52/*53/*
53 * io_uring_setup() flags54 * io_uring_setup() flags