From nobody Thu Apr 2 22:00:02 2026 Received: from mail-yw1-f228.google.com (mail-yw1-f228.google.com [209.85.128.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5682513D891 for ; Fri, 13 Feb 2026 03:21:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.228 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770952892; cv=none; b=MDt4HwvKVqayPd608me9+w1Vr2gZt58x2UIt87rIERQDXzqaYXeXFis4vd49sh9Jzn1uaxAEt9+EhrMyO01WfB3loeYm935WOKT4q0e7FvuC+EvYZTP3h7/JGXY+H5WOzXqXtlqBIOpS/XsvIwM3m96uv4ESrVBshWO3FfARzWc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770952892; c=relaxed/simple; bh=SK7lNVVt3R3qPwh5gNARbgazIAbuys8j5HASsZvezDw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=XKiYss5fmRggCpEma3BbL7xO09geSQcAq2KzKMxXlh9faxm4R+FcD34xyn5MZWd8BBjvgDnHfMU+iqGNHdT4FqgdeMcv6lCTvq8LAZFrUOecCoHdvdGvO5w4cjii5sXjK+8UnuNtPaYSo19QmRCW1SuyL9nHYqoRwL0NimOy8xI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=purestorage.com; spf=fail smtp.mailfrom=purestorage.com; dkim=pass (2048-bit key) header.d=purestorage.com header.i=@purestorage.com header.b=EYXE7yL0; arc=none smtp.client-ip=209.85.128.228 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=purestorage.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=purestorage.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=purestorage.com header.i=@purestorage.com header.b="EYXE7yL0" Received: by mail-yw1-f228.google.com with SMTP id 00721157ae682-794c5ed7936so349527b3.0 for ; Thu, 12 Feb 2026 19:21:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=purestorage.com; s=google2022; t=1770952888; x=1771557688; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=XrpUavd9Jn1m5PTul6V14FFmKgASSL32mDcwIWu9GWA=; b=EYXE7yL0kLb2SsEfTXJ9oUwwVGzbTtyqyIrAFq6W4osN+hhUH55vm0r40JMXBj+g+4 qA/eQ8GdPuYr1XncRRtEaBNonMsZAYlWIlJuU449ghqbgckfnshqFOoUkSnzJ0v8FcPc a4QTlbVXrPwWPHso2y+HxY8zNJTBAG0gPpViZ8UWMYa4aX3VE4kx2ahDMJ9/O8naiejg qN6sVAi5LXnvwGzUMNBS9OIO5DAEbDoqEGYotSDiDIphY6rhiZOQZPfLnaH8uSwc8lCe fUKhBaLx0yf1rCthfeKigiDZEVy1ZDRtO76AV5f1sw26ayLu0zHEPeSPRcUW9tNCjFuk mecQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770952888; x=1771557688; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=XrpUavd9Jn1m5PTul6V14FFmKgASSL32mDcwIWu9GWA=; b=nH9PHNddYuXG6zPA41OXguWUyAuRhgSM5B/7qw6Zun8adFAtkVuMoIWNDJl/vJfyYo azhd99WUlJu4gRGlsXfxiDca3Pw9VNZ1PmgbpZufHqYbw+XWgiAu6RdCrXf8uKmnbibu vjhyuqvHVl+zDns6NXqMZNtLtPTk9E/LL+IMTrI6/bpKpVEPfTN2Ld7EBjn+JcRXV0K2 LTfrNY3Nusm1EPGi85y2t/q9KUaOI7N/2dmO9v67ErGyGnA22hKX6/NZgDKspx2xdwHb nqHTK2U50nsag8PaQd55kjeZ9dX/e0eley+43bInu2DlFtDB4aVVNevPKN4QlsEIwyRl R3UA== X-Forwarded-Encrypted: i=1; AJvYcCVl2uw/2c0gpNai4y5OSyMq1e/N00KsoZI8IHcxtLx4tf2Hb46WjtgG0u6a4F2jBR1GBY01JVmuPI9vMxY=@vger.kernel.org X-Gm-Message-State: AOJu0Yx9P9tzfvp6NsqXTrK1JYZzfDDve4g6HFZxwBLa4fs8+XIIPSQl guXS6f4mnqgw8S6ZAKtUX4YpUtHsQv6z61c2BE9A4CU9VydAVwXB9yAEwXuem8vRUm/2NKrWiux NPV8gJQMVeaqoyKS81lYUWkWnnlNQgTG128yB X-Gm-Gg: AZuq6aIiwg4ewtnqYoHT6flFdK+3bBgpsSskED8+jpejta7OuW7oZPPPh0qsi10fZvL zkzFgkbAn3FGNNfK4P9pERjKVATDwPTFhirdHJG1h/ydjFHuDVG82Bp1iz4DHXzWbQvs9DQePM0 bonAsEquwZg1tqRmQBzpeW/70LJdTzkiu8v1KZtdnSwmi16NtZpge6gqIT0c1qufnEsmtiN7Sqr YnWLDydUHlUsoftCpi6uv065Ssn9sO6DNFpT41pr84vJODXiZWR3i6C/vwMyMkulnTyxgTwvIyw ikLE4+H52sUaRvNLF2T0gER2MgetoSZFbSvZ8VEHK+84tNFE0coyFrkMfisv6WgfMf2rsnt64Uk QyK1twHbXNkxniUGRIMe2RutuyJZmFZA0ZDMPVfd6cI5tzNyhismbHQ== X-Received: by 2002:a05:690c:c509:b0:796:228c:ed96 with SMTP id 00721157ae682-7979e6be482mr7685947b3.0.1770952888296; Thu, 12 Feb 2026 19:21:28 -0800 (PST) Received: from c7-smtp-2023.dev.purestorage.com ([208.88.159.129]) by smtp-relay.gmail.com with ESMTPS id 00721157ae682-7966c2328fdsm6537797b3.14.2026.02.12.19.21.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Feb 2026 19:21:28 -0800 (PST) X-Relaying-Domain: purestorage.com Received: from dev-csander.dev.purestorage.com (dev-csander.dev.purestorage.com [10.112.29.101]) by c7-smtp-2023.dev.purestorage.com (Postfix) with ESMTP id AF4A7340705; Thu, 12 Feb 2026 20:21:27 -0700 (MST) Received: by dev-csander.dev.purestorage.com (Postfix, from userid 1557716354) id A9CBFE41DCC; Thu, 12 Feb 2026 20:21:27 -0700 (MST) From: Caleb Sander Mateos To: Jens Axboe , Christoph Hellwig , Keith Busch , Sagi Grimberg Cc: io-uring@vger.kernel.org, linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, Caleb Sander Mateos Subject: [PATCH 1/3] io_uring: add IORING_OP_URING_CMD128 to opcode checks Date: Thu, 12 Feb 2026 20:21:17 -0700 Message-ID: <20260213032119.1125331-2-csander@purestorage.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20260213032119.1125331-1-csander@purestorage.com> References: <20260213032119.1125331-1-csander@purestorage.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" io_should_commit(), io_uring_classic_poll(), and io_do_iopoll() compare struct io_kiocb's opcode against IORING_OP_URING_CMD to implement special treatment for uring_cmds. The recently added opcode IORING_OP_URING_CMD128 is meant to be equivalent to IORING_OP_URING_CMD, so treat it the same way in these functions. Fixes: 1cba30bf9fdd ("io_uring: add support for IORING_SETUP_SQE_MIXED") Signed-off-by: Caleb Sander Mateos --- io_uring/io_uring.h | 6 ++++++ io_uring/kbuf.c | 2 +- io_uring/rw.c | 4 ++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/io_uring/io_uring.h b/io_uring/io_uring.h index 503663d6fd6d..0fa844faf287 100644 --- a/io_uring/io_uring.h +++ b/io_uring/io_uring.h @@ -528,10 +528,16 @@ static inline bool io_file_can_poll(struct io_kiocb *= req) return true; } return false; } =20 +static inline bool io_is_uring_cmd(const struct io_kiocb *req) +{ + return req->opcode =3D=3D IORING_OP_URING_CMD || + req->opcode =3D=3D IORING_OP_URING_CMD128; +} + static inline ktime_t io_get_time(struct io_ring_ctx *ctx) { if (ctx->clockid =3D=3D CLOCK_MONOTONIC) return ktime_get(); =20 diff --git a/io_uring/kbuf.c b/io_uring/kbuf.c index 67d4fe576473..dae5b4ab3819 100644 --- a/io_uring/kbuf.c +++ b/io_uring/kbuf.c @@ -169,11 +169,11 @@ static bool io_should_commit(struct io_kiocb *req, un= signed int issue_flags) */ if (issue_flags & IO_URING_F_UNLOCKED) return true; =20 /* uring_cmd commits kbuf upfront, no need to auto-commit */ - if (!io_file_can_poll(req) && req->opcode !=3D IORING_OP_URING_CMD) + if (!io_file_can_poll(req) && !io_is_uring_cmd(req)) return true; return false; } =20 static struct io_br_sel io_ring_buffer_select(struct io_kiocb *req, size_t= *len, diff --git a/io_uring/rw.c b/io_uring/rw.c index b3971171c342..1a5f262734e8 100644 --- a/io_uring/rw.c +++ b/io_uring/rw.c @@ -1252,11 +1252,11 @@ void io_rw_fail(struct io_kiocb *req) static int io_uring_classic_poll(struct io_kiocb *req, struct io_comp_batc= h *iob, unsigned int poll_flags) { struct file *file =3D req->file; =20 - if (req->opcode =3D=3D IORING_OP_URING_CMD) { + if (io_is_uring_cmd(req)) { struct io_uring_cmd *ioucmd; =20 ioucmd =3D io_kiocb_to_cmd(req, struct io_uring_cmd); return file->f_op->uring_cmd_iopoll(ioucmd, iob, poll_flags); } else { @@ -1378,11 +1378,11 @@ int io_do_iopoll(struct io_ring_ctx *ctx, bool forc= e_nonspin) continue; list_del(&req->iopoll_node); wq_list_add_tail(&req->comp_list, &ctx->submit_state.compl_reqs); nr_events++; req->cqe.flags =3D io_put_kbuf(req, req->cqe.res, NULL); - if (req->opcode !=3D IORING_OP_URING_CMD) + if (!io_is_uring_cmd(req)) io_req_rw_cleanup(req, 0); } if (nr_events) __io_submit_flush_completions(ctx); return nr_events; --=20 2.45.2