From nobody Sun Apr 5 13:04:14 2026 Received: from mail-oo1-f97.google.com (mail-oo1-f97.google.com [209.85.161.97]) (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 D4EEF227BA4 for ; Thu, 19 Feb 2026 01:43:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.97 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771465427; cv=none; b=Qypi0wI5fqGcAcvHa1JOVISn+WHZixmObOHmAp6hHORYWh9sGzWVkdPq5g7LJspmP5rujX6+DM/9K3CVXcAZDFOseqAnYDQtWRKOGXPNujDaAgmK49p+qSHRY6jAkjqeN9/idZUXdFbVDc/zfYLfMyCf5UmlKH2dAiISZtBLHAI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771465427; c=relaxed/simple; bh=tV41JT4N82HtLiVT4LDve0d5RQZWyngFmDTN+LM2KSQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Jj4pjT04fXLMvVjKzRE3BLYUXCzPdkxtvuS6KF3czRKjouie/LQTprGfLggXlhthrDPNMPXbSod9mkxCgrFHThd6NcI22HHAOt/bMq1Zs+C7evTkeQjUQnDyT2VF6uJRW+vW9K7bD0vCwbBWZt0t6lahvTnsT5HDnzQmO2zqKHY= 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=K1QMBc0t; arc=none smtp.client-ip=209.85.161.97 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="K1QMBc0t" Received: by mail-oo1-f97.google.com with SMTP id 006d021491bc7-678061ab66eso32478eaf.3 for ; Wed, 18 Feb 2026 17:43:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=purestorage.com; s=google2022; t=1771465425; x=1772070225; 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=cD5qcELz1szuWzdXkgd0fgG80WegTttIPZeozvdhos4=; b=K1QMBc0tijEvOQMuBRX61IYuaNingv8UqIP75jzJdtB+oFOFSFJX9A22Wgt198UeVl Gg/EqhboLZj4eUEifY/Lg2fqZGgsaxon60yMafnoAE074OSryzJXmtXCm3YTTvItucTm Rnuz40FD2Q4SY7Ah6Y0EdadYgqjO7mzbFHyjc5baGrHRnin7kyE0/wE1zBazLNMq6VFi 60TzMK+4+q1OQt1dwNB53J1G8XKl3XaA/M5N4nYwsn0otrran7CuSSV7Sh2umOF8O1u5 Z4Dkj0h3ZXYRzQognhp7Y0kWtet0yqwjQ6WQegTL+QxD1Rtv1ESF0I39+GyTfB7RRQ8h 0O+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771465425; x=1772070225; 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=cD5qcELz1szuWzdXkgd0fgG80WegTttIPZeozvdhos4=; b=LOgd1/SnAjjnWGTy/jOSuh1ryzK7zDZUU0Vh2xfGQGfcuwdgRHqJ7pyFfAjJUyp4J/ rHb3M3tuvQLHMhorJZ04RGfiSho5C0ZoJ2MO9C5Uancn1KCKJvMXK+o3InsCXgrDBa+o WBG+ElmTKIbsyCfcPhkJPLOZzpJyazymjR4q0uVt+I7WCb9RrqA6M6yuwaBXbrAYXCUh rYU+r2+vp3p/+6dE++NWy17fgOT4RpvQMOdxmYZnwu20PtdpmSSXVesZ2iaiSkwZL6di NPeQ61aaNcv7vhtuCi3Mqfg6KAM8+17UwnN9MmZziMqGburqiq21hxm8nZiN1Cv8ENG5 DatQ== X-Forwarded-Encrypted: i=1; AJvYcCWYmZieJMxxRAobGkSsdu/gR07WTXuLunHB80kSidKhDNCHvwAiVBzuNSFvLiivHHxUd+ZQ9LSopoqgikU=@vger.kernel.org X-Gm-Message-State: AOJu0Yw3MFQAbWvr0Mivh4lswrNyDHsP+vqWFrHREMw3INKZ6imo0JDN 8ARnSlzfu5RiKReOyyEfTW5lOxtVsArghINNyK3H7huhM7YYCjKwY0FDKav9fTtJClq8HPGttZe PNrhPnedZeYGC+kyDSp83fQGbLZjPIAY2bHVs X-Gm-Gg: AZuq6aJSBVm/2gn3oLYkWWkPLNxJ85EN0tNRnmhSKtWFS2vDMR9XM7UHGrd2A5R1swW H86anMRzVpZ5R34hacToCTBaNtZWBdJxAPieOzXYWBkQ0K8AjNGB9zn4OAfyDkO/jpv5ab7She0 FtTWA3byVjm0jRvteVfpay5vDVZLF1He5Mw+Bgq6b2CjoYs6fratLdm0M0SjR+7YUN9fTPmZdEj TVTrWclAxrclc214yYVI1Xeq0+D3Iuq5R5unOsI6MfOvBB2jvhW4wMTigAgFfhtj/HQRrgRVbfr C3yr8rLKUSxzKitNnC9s1Kts2WJSTwCI5Ng9gy4vC/h7+ZwSHQBme2WxfmlwN1BmdNSbT9+q2sv Vqo36HvMUPBPW6b23+8LESEwhhqe5mJhsPeqfrH7T8LB06rLxxZOqYg== X-Received: by 2002:a05:6820:498f:b0:679:ae61:ed85 with SMTP id 006d021491bc7-679ae61f23dmr566445eaf.1.1771465424693; Wed, 18 Feb 2026 17:43:44 -0800 (PST) Received: from c7-smtp-2023.dev.purestorage.com ([208.88.159.129]) by smtp-relay.gmail.com with ESMTPS id 006d021491bc7-67997aeee34sm737226eaf.5.2026.02.18.17.43.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Feb 2026 17:43:44 -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 D8A4A3422C7; Wed, 18 Feb 2026 18:43:43 -0700 (MST) Received: by dev-csander.dev.purestorage.com (Postfix, from userid 1557716354) id D4182E41D2F; Wed, 18 Feb 2026 18:43:43 -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 v2 3/4] io_uring/uring_cmd: allow non-iopoll cmds with IORING_SETUP_IOPOLL Date: Wed, 18 Feb 2026 18:43:34 -0700 Message-ID: <20260219014335.9061-4-csander@purestorage.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20260219014335.9061-1-csander@purestorage.com> References: <20260219014335.9061-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" Currently, creating an io_uring with IORING_SETUP_IOPOLL requires all requests issued to it to support iopoll. This prevents, for example, using ublk zero-copy together with IORING_SETUP_IOPOLL, as ublk zero-copy buffer registrations are performed using a uring_cmd. There's no technical reason why these non-iopoll uring_cmds can't be supported. They will either complete synchronously or via an external mechanism that calls io_uring_cmd_done(), so they don't need to be polled. Allow uring_cmd requests to be issued to IORING_SETUP_IOPOLL io_urings even if their files don't implement ->uring_cmd_iopoll(). For these uring_cmd requests, skip initializing struct io_kiocb's iopoll fields, don't set REQ_F_IOPOLL, and don't set IO_URING_F_IOPOLL in issue_flags. Signed-off-by: Caleb Sander Mateos --- io_uring/uring_cmd.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/io_uring/uring_cmd.c b/io_uring/uring_cmd.c index b651c63f6e20..7b25dcd9d05f 100644 --- a/io_uring/uring_cmd.c +++ b/io_uring/uring_cmd.c @@ -255,13 +255,11 @@ int io_uring_cmd(struct io_kiocb *req, unsigned int i= ssue_flags) issue_flags |=3D IO_URING_F_SQE128; if (ctx->flags & (IORING_SETUP_CQE32 | IORING_SETUP_CQE_MIXED)) issue_flags |=3D IO_URING_F_CQE32; if (io_is_compat(ctx)) issue_flags |=3D IO_URING_F_COMPAT; - if (ctx->flags & IORING_SETUP_IOPOLL) { - if (!file->f_op->uring_cmd_iopoll) - return -EOPNOTSUPP; + if (ctx->flags & IORING_SETUP_IOPOLL && file->f_op->uring_cmd_iopoll) { req->flags |=3D REQ_F_IOPOLL; issue_flags |=3D IO_URING_F_IOPOLL; req->iopoll_completed =3D 0; if (ctx->flags & IORING_SETUP_HYBRID_IOPOLL) { /* make sure every req only blocks once */ --=20 2.45.2