From nobody Tue Apr 7 09:25:44 2026 Received: from mail-pl1-f226.google.com (mail-pl1-f226.google.com [209.85.214.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 942E234B194 for ; Thu, 19 Feb 2026 17:23:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.226 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771521787; cv=none; b=BywXSEQHprso0tgI3KGtlXPziEsnSbkJXjsQJuhAcCSGNwuhlwhQnO3460fckWUfAh3sgouq5gdaEdJZanRuqHgkVYUdvakZrc/07F7gVAoxN5wvvfrsB2a5mHWMQEAifqXo0jCj6Oc5Evc8eIQLNVl4wCh6PPi4wFRAv99MseY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771521787; c=relaxed/simple; bh=tV41JT4N82HtLiVT4LDve0d5RQZWyngFmDTN+LM2KSQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=S8JaPDp4WBk4HJeEFerzz4RnxnvhJGriO+OaP4OTNBSUHuYHeaXHoruJQC5WgWs01u07tl9dwDWJ/o8EcDk/KHMK6+C2fwnJnmAY5f9nCxwQvSd9nV3WE8/IfgSA4JsSj4fnRaXYv/fvreWM8r3sgcM8RJX+LOEKyIdypo9nPxg= 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=JAB4HSGa; arc=none smtp.client-ip=209.85.214.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="JAB4HSGa" Received: by mail-pl1-f226.google.com with SMTP id d9443c01a7336-2a8fbd09b09so561675ad.2 for ; Thu, 19 Feb 2026 09:23:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=purestorage.com; s=google2022; t=1771521786; x=1772126586; 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=JAB4HSGaBijit6dpJZg285XUG7gn1q7WgnAOzFzjKDjnF5luVR1E4AirCW95LaNj1H VhCUPbJEUIlIJxgqGPozbUSd5LCjEsZzsWOrjIdGAHhmdC3DH9RrwDKeYmt81K8nuzkI BClqIOUnmUItP7xaeXvUm2pxjGgh+VwAjOHxDxt0XCWdRyMrcS5eH6ZKxgGdA1NWwj81 X/j6g5SCMyKulSUi5bAKHeBma/U4bsHc7NnAXsJYHJDY1QMglCM/Q8DrhWx6X5+5q+Bq eQOuFXnH6/hmvnoVQN6JbPKC4VbH0rUOZ8YSzW9+zlhgKAZePw2z336031oWMTMSCb4f d6Zw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771521786; x=1772126586; 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=tBrfOLgug0aMb86oBLtka5ir8kHgm1PtpzZTXoiF42RGSZ6F/N8gK7Q8uD1aN9DqFk vS4ibSkcbYpozfj9MGvDQrrVERmblssVPhiMYLyfRyrGhEsFVICMULiOBLFpW670AbiK ecEfQcNnrQaUxZqdeFX+9+L5/Py/AzyhmHyDL2VWMwU2Ko4JYK6fLQhkMyzA2qJboSNK NHZEjh2meo5o3ZDwESNHvNQzvDcZ61EthWazQtJJkzleOQl81FC0/TcfF3uwBj87xfbU LazTnLfE3DX56AxCWVXZLnPlAEVShpQcDmB/hFX8OSkNNxNDpyr3B98ZpZcMIJNrkgTS JEZg== X-Forwarded-Encrypted: i=1; AJvYcCXjrDvdOgu2aaTm5RrHZSwUeiBw4GYv6G0qRj+mx/oDXHpyxl0yNI+krlI/xeT2PyYKoSpzWkcxO/w8b/Q=@vger.kernel.org X-Gm-Message-State: AOJu0YytRIHzqb35oO69HVkI8J5Xk9sKjgywvaZTQVn/9usxrVNMg6r0 W8fBgDtM2xa054CniUAmD657CMPL68/AuRDgld+r+JLCoAgxiCH/J65EP7Y+W4Z/YsvBygZZiSn JQqzlruhjL132Uw4uoiKOBUeqrg0y2vX6CaMv5n6IlBOw6cePh/VP X-Gm-Gg: AZuq6aK+MG12PFIOWF4BvF3WbhEo/MadnfCIGa6QwbQ8REW25sr+w55OxAKxk66IrPk 7R+lKE39IQ4ZZAcF9Zmk/K5KUPWnYJ4/FKE5Z88kJVoxNzWXzvwXtb2jh5QpV/XHtP1zi7DjqDd NmREgTINHw89BAyPd9LsI4pDt4t/ih7PodVdIkdxdv89RcAxmWMVP+twh10FLHOxB2DRo8zDojb FOQsVbsM0RqX6Ygyjjvmr7ZWB6oBZqANpg2upJ4//PkSCNn5BE0MENwjMcFVmfl6J11+2xJi6gM lPVzzNzNzzMVVgQtIEVy2DuZwexzAEloYhv7k7zozVL5N8a9iLUL5ukigseJFPZIBXk2E9cyigT GzQjgo5WJ3lD4mUxCBLqPzhFlmLDGMPYQ3T03wx4= X-Received: by 2002:a17:903:1b63:b0:2a7:8bf3:5674 with SMTP id d9443c01a7336-2ab4cb003e4mr163336915ad.0.1771521785949; Thu, 19 Feb 2026 09:23:05 -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 d9443c01a7336-2ad1a78f7c0sm21662705ad.28.2026.02.19.09.23.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Feb 2026 09:23:05 -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 2F5A4342181; Thu, 19 Feb 2026 10:23:05 -0700 (MST) Received: by dev-csander.dev.purestorage.com (Postfix, from userid 1557716354) id 27164E41AE3; Thu, 19 Feb 2026 10:23:05 -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, Anuj gupta , Kanchan Joshi , Caleb Sander Mateos Subject: [PATCH v3 3/4] io_uring/uring_cmd: allow non-iopoll cmds with IORING_SETUP_IOPOLL Date: Thu, 19 Feb 2026 10:22:26 -0700 Message-ID: <20260219172228.429479-4-csander@purestorage.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20260219172228.429479-1-csander@purestorage.com> References: <20260219172228.429479-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