From nobody Sun Apr 5 16:27:56 2026 Received: from mail-pg1-f226.google.com (mail-pg1-f226.google.com [209.85.215.226]) (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 D323213B58A for ; Thu, 19 Feb 2026 01:36:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.226 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771464962; cv=none; b=is8nDglcGZPQyqWjACsjdiiRgVftA+UOzHGHJ+Y3JLsXxKV7Ta3jc+tZRUatMcYwXRcygGFwCCP0L4udbhmFohMVsbMJWmDiIbATT6wn3km9O/JDKbRPQls4hBdeEbAEJ2zEymSbT3V86LBk8q1tCzwAAwIeVTZLKSg6spUBj9k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771464962; c=relaxed/simple; bh=SK7lNVVt3R3qPwh5gNARbgazIAbuys8j5HASsZvezDw=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=e/gUZw8UOg4UbqxatVHXF7TkExb1r8ADB0fsDgglOv2QFuaeT9w1C90EYUSQ5NseITVG6SyF4+mnBpEicupnDNW8EEXg790XUWIBEDQfBwklEjEwYTfh8B4MuctK8qkiXTkdEcanLb51AkX0RGEovd1X1GYiy+KHHuK12cpTE/8= 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=Iwj0GP0H; arc=none smtp.client-ip=209.85.215.226 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="Iwj0GP0H" Received: by mail-pg1-f226.google.com with SMTP id 41be03b00d2f7-c6e85f76efeso45438a12.1 for ; Wed, 18 Feb 2026 17:36:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=purestorage.com; s=google2022; t=1771464960; x=1772069760; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=XrpUavd9Jn1m5PTul6V14FFmKgASSL32mDcwIWu9GWA=; b=Iwj0GP0HElzidBP+a3etf5yOBEIlyQzzOqMlYEozmRz34lPo/hALyb/Hk0RU32fp0s ozpb4KP8l812MA6aHSzmrST0/PR+2RTxpLmSFzx5P9ncsdwjlOofAwCfyy5tMzRiAnPD Y/tyn/30agVjyeINtR8+TJOuk0gO57KwMPJWkST8FacDKvBt+gwvJ0f5oSgHXfjx0FpC 4P8MBBDZ/99cX1RCTP/8w7jpMJIyx++H8O1dRbZWROgpYDjA4m3baVxgnxTWO8ay+hXM 7thWTWLO9k81+/R/MoPVIfWp5Ih/7NxgtJDemXB/WCwnI40t2C8oHbA/FLqI25B4FfAp W4qg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771464960; x=1772069760; h=content-transfer-encoding:mime-version: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=JZxbXeAnxmtk+Mqv+Imvc6f+h69Pn/NAwbl0inLk8niV6as8jy1b+CxhBJdVfC2nsb P4mvNperp+dBccyA7oinBOa1DAOYuQM+UUKnQREQy6a+darilZU++NS9yiPDXDl5eZXs c/GBUMt1lH6OwtLgUJ1ueSG5lYh0eHk17AqRXpSZmMB6e60XxhS8c7RBSJ83Emj39cvz kB+Mx5mEvPY6i+yyvDxU+d6cnGLn5SFTl2IE6g+8cVJMsVWRXvQwVVhWMryqoIDKRFtc zKpsfkiszaR3SZnopFdMpnbyy/hUMI94q7UZ/jf7H+C6uH4BXz3UqqzuMKPZ5pv7B0VC AsnQ== X-Forwarded-Encrypted: i=1; AJvYcCUosAdiqUg2yXowqZcarXhYGJifcKzve6uVE9MmRLHjltBbM+Opcsy1FX9pwjrVB9R5HwsObo7sLH45OYI=@vger.kernel.org X-Gm-Message-State: AOJu0YybK849RSwNlsu/8FORNENs0KKbR0pw5kveeYB8DkGf/MHg9wNx lHoWaP2qUd+/64KS1vOI8L8QAyc/f2unAH0um5FXTcdRRVTwewzvBM0vSnmFZFQ75Jo8hgV4xea ZApJTP+kq2W3yE8D4dxGMrn9faYu5syqpnHLKs32NGyQlYLtOr9/8 X-Gm-Gg: AZuq6aI1Qs0R9ZHL0KZvFXBWyt8MbgiPyo5GuCSq2KTB9xHmjIDM81IzZsUbixPSqwA IMvD68vThMuOXsgbgahsHsvJqSlleVRgu0aJbRoY9Xsb/ylgN+cyH7xyzj/IGYvt9KGl+pXuH7L eyjpQGd0/0K66+cwWtpJmaimEJGN7f7ffEWClRpvv4q1eKuk94Wt4YicWZwRtC6SCEOANi40Ll5 cIaXPyoOkdEwFe7qIlkoMPCPP6+Q+Ye6W9vlrJUGZkCS+UlGQfgBRDstxpDN1fODWZc/13T/SqP Ls/0qM2JChP49Y8cwUxeyMlC0UxOUoHd2aYGmtpB7okDVhr7KrbWd1SQGB8Xnff75/jkYGt4gPg 9Z1rILFopXGHj3RwHuYom2xa8cK2+BDkDSTsLPeY= X-Received: by 2002:a05:6a00:1142:b0:823:c646:28c8 with SMTP id d2e1a72fcca58-824c5ec6f49mr13730751b3a.1.1771464960045; Wed, 18 Feb 2026 17:36:00 -0800 (PST) Received: from c7-smtp-2023.dev.purestorage.com ([2620:125:9017:12:36:3:5:0]) by smtp-relay.gmail.com with ESMTPS id d2e1a72fcca58-824c68f0dafsm2093732b3a.0.2026.02.18.17.35.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Feb 2026 17:36:00 -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 2224F34014B; Wed, 18 Feb 2026 18:35:59 -0700 (MST) Received: by dev-csander.dev.purestorage.com (Postfix, from userid 1557716354) id 1399DE41D2F; Wed, 18 Feb 2026 18:35:59 -0700 (MST) From: Caleb Sander Mateos To: Jens Axboe , Keith Busch Cc: io-uring@vger.kernel.org, linux-kernel@vger.kernel.org, Caleb Sander Mateos Subject: [PATCH] io_uring: add IORING_OP_URING_CMD128 to opcode checks Date: Wed, 18 Feb 2026 18:35:34 -0700 Message-ID: <20260219013534.4140776-1-csander@purestorage.com> X-Mailer: git-send-email 2.45.2 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 Reviewed-by: Anuj Gupta Reviewed-by: Kanchan Joshi Reviewed-by: Keith Busch --- 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