{
  "slug": "io-uring-cancellation",
  "term": "io_uring cancellation",
  "aliases": [
    "io_uring cancelation",
    "IORING_OP_ASYNC_CANCEL"
  ],
  "definition": "io_uring cancellation is a request to stop matching outstanding operations, with a result separate from each target operation's completion.",
  "note": "For a single user_data match with flags zero, the cancellation CQE reports 0 on success, -ENOENT when no target is found, or -EALREADY when immediate cancellation is no longer possible. A completed target and an incorrect identifier can both explain -ENOENT; inspect the target CQE. [cancel-api]\n\nUse distinct target and cancellation identifiers; do not recycle the target identifier until its completion and all cancellation attempts targeting it are accounted for. [cqe-identity] In Linux v6.14, a bulk counter can include running-work results, so it is not a completed-request ledger. [cancel-source]\n\nRead/write payload buffers must remain valid until the target operation completes; submission stability does not shorten that lifetime. [buffer-lifetime]",
  "status": "shipping",
  "advantages": [
    "Makes cancellation an explicit operation whose result can be correlated with its target."
  ],
  "limitations": [
    "Cancellation is not rollback or persistence confirmation.",
    "The single-target result convention does not describe bulk cancellation counts."
  ],
  "related": [
    "io-uring",
    "io-uring-cqe",
    "io-uring-linked-timeout",
    "io-timeout"
  ],
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-10-17",
  "citations": [
    {
      "id": "cancel-api",
      "title": "liburing 2.9: io_uring_prep_cancel(3), single-target results and completion handling.",
      "url": "https://github.com/axboe/liburing/blob/liburing-2.9/man/io_uring_prep_cancel.3",
      "accessed": "2026-10-17"
    },
    {
      "id": "cancel-source",
      "title": "Linux v6.14: io_async_cancel_one and __io_async_cancel, including the bulk-count path.",
      "url": "https://github.com/torvalds/linux/blob/v6.14/io_uring/cancel.c",
      "accessed": "2026-10-17"
    },
    {
      "id": "cqe-identity",
      "title": "liburing 2.9: io_uring_cqe_get_data(3), application-supplied completion identity.",
      "url": "https://github.com/axboe/liburing/blob/liburing-2.9/man/io_uring_cqe_get_data.3",
      "accessed": "2026-10-17"
    },
    {
      "id": "hesela-uring",
      "title": "io_uring: completion is not a durable commit",
      "url": "https://hesela.com/analyses/io-uring-completion-ordering-durability/#cancellation-results",
      "accessed": "2026-10-17"
    },
    {
      "id": "buffer-lifetime",
      "title": "liburing: io_uring(7), SQE pointer lifetimes and data stability; current manual reviewed 17 October 2026.",
      "url": "https://man7.org/linux/man-pages/man7/io_uring.7.html",
      "accessed": "2026-10-17"
    }
  ]
}
