From nobody Thu Oct 2 05:05:14 2025 Received: from mail-oo1-f100.google.com (mail-oo1-f100.google.com [209.85.161.100]) (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 5462A3128D6 for ; Mon, 22 Sep 2025 17:02:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.100 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758560576; cv=none; b=WGhoMoGY+ek8dNE1c+TzWADc1nFWg46ipPAZ50PR095NVKhmWA8KLQnWIMagXXKgCbaOEOevbfFRlyXVMyKQuCboVX5pFonDrrzyIRPKgVuy6pWVFRa8ElDlH1fVwdLFY3vfB8JdwwEdlMd2ZlyID2p5/yWLSd7TvWKOGRXvnHE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758560576; c=relaxed/simple; bh=JypIUl1J7I4aTO6RIngxwIbvE3Bf0MU28iQ5ahgADgs=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=r12S15oI8HHNTnuAvO8nU6Q0FyfZRXZRDGMKRYOXZcFDRKiwejT6zz0yV/3ZfEU3B7CHQuUVZyd1CJLgm0L4W+hyegJ+ZimeN7C+YzkE34WMpUQtfhd3zHaThMhnzYqLBvjE7IXYkXrvHdcOr/gEYy5PE3Bcm2Iq4o9nGnhqYjk= 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=XjRH3wMZ; arc=none smtp.client-ip=209.85.161.100 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="XjRH3wMZ" Received: by mail-oo1-f100.google.com with SMTP id 006d021491bc7-6217352bc25so61502eaf.0 for ; Mon, 22 Sep 2025 10:02:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=purestorage.com; s=google2022; t=1758560573; x=1759165373; 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=X9Il64cUpTJjRu6b4mQHWeErfD8hD7D/QYu++Gqs37U=; b=XjRH3wMZYxbFVBQNU1/ia6FN7L8QvxflhV45+Y2WQYH2F3hwnn8rQacPoQs5oGLFrc QYHDLJRrx9sF+8+Bo1HP2JRwp0CYG+5s72AntDyWp4Br+a6bASuDdmyCI+PfWZw0AVa0 /h5MPHvnoNAoV5TR7RNVtYBzG2aPwV3i8MjFnoNUPuM7Jh9ok9Qz2pSSnk0n2Z0tW1mO vEa5zLxVVWQegPr7zg8av5olR4lqwoSAa59nNogsURQSIFAPVFQRnmyw8fPWk/bD9c4G mv4EVFm0J3IuZR8sMVMtEryb3Xzm5GurmRxunPlI4SGapgs5VxS3G/xcCyp2oXIDUDnr L62A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1758560573; x=1759165373; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=X9Il64cUpTJjRu6b4mQHWeErfD8hD7D/QYu++Gqs37U=; b=uan/rCwOCyoVIN16zLC7QrcmYzbuNBORDjX+30iunIQB4OneJRVI1gGqPtxpJiF7FO DTHZ3gCb0r4UmO30YunVdxKKGpg71OIClE1Awud13uevrPO5MaEnjV2jP9Umv1mholsM OpVOYhTh+tI52Lv7w6FnLGj13iH3cQsBU3xJxGWzJL8D+fGuDZlv3Qk5w2gUzjZVQsWr AcsElaa0OGEVvaURMb8ViCmLFsNR9E+FlXZKIU3jjpqNbVsCN8PxpkX5U2YzYLdAFcsy rmbosvjhJVRHwnlVri+H6KZBszY6rs4jGaXfh/wdJvbApxDIcsHGyEgJatSNLZo9GIRd VBkg== X-Forwarded-Encrypted: i=1; AJvYcCU5zRStZFkI2kccUfEPD8mst+X31fThgfyDa+T4fsQvRxLRZ1CegsCKzljN+7rY3h0YP0lZ48kiSi0jj0s=@vger.kernel.org X-Gm-Message-State: AOJu0Yx39XBmvjos4mA009P2QTH3UM9esRtzOfMhagAMHaWdN8DTWp8Z lFqDKlPHAEcVbAXqozLc4u67tK5z7a9eFD6ZVXdEJ8B2LW1suIopVgjMQ7aSzybXrLL8/702LiO nNO94KMqBgCHuu/dAFHBEJRKSZVRBpCq9wV7Q1Owo55eFjXOSo0zq X-Gm-Gg: ASbGnctq4Yr5ZpVlMKhq1Curvkl7btUcdcObzjBVRshp2CU2zRe03LjW/IN8HuRGlRo /Z3EO2ZORhWmZ3y0OLo23lJtGm91zmXAFgcPuPG7lTy+6hzJhT97PNHVE7M12Tmq4z/E+TB+GUY MKbc4TVz0ndDDpr8C14Js0EbuKinxxRUaj1Ny3TsWQh9TTz7Huo/UtjLcKFfp5ulbMQ9FD2TsI4 m9SICk2Z3gR3B1fGCRQJTGRaAhzgRNg/B3joqCe7S2SCh75IShU1sAZY3MEVMTf4T2Oep170zET iRE8MYBLa3QE4ea+1RaqrBeo6q6rUO45MFytd7tUc3QwYFxDWukQShzQDQ== X-Google-Smtp-Source: AGHT+IGgvjnxvdko/nCuAkBCNCdpc3qhLNgvtxgilGl8hD1yrabr5ZA1gFKHJa7ofAq5Qix3umS3FgQxvi+X X-Received: by 2002:a05:6820:c8b:b0:61f:a265:6b9c with SMTP id 006d021491bc7-62724fddc3emr4069963eaf.0.1758560573320; Mon, 22 Sep 2025 10:02:53 -0700 (PDT) Received: from c7-smtp-2023.dev.purestorage.com ([2620:125:9017:12:36:3:5:0]) by smtp-relay.gmail.com with ESMTPS id 006d021491bc7-625dae1d688sm484015eaf.9.2025.09.22.10.02.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Sep 2025 10:02:53 -0700 (PDT) X-Relaying-Domain: purestorage.com Received: from dev-csander.dev.purestorage.com (unknown [IPv6:2620:125:9007:640:ffff::1199]) by c7-smtp-2023.dev.purestorage.com (Postfix) with ESMTP id D6914340408; Mon, 22 Sep 2025 11:02:52 -0600 (MDT) Received: by dev-csander.dev.purestorage.com (Postfix, from userid 1557716354) id C3F93E414A1; Mon, 22 Sep 2025 11:02:52 -0600 (MDT) From: Caleb Sander Mateos To: Jens Axboe , Ming Lei , Chris Mason , Josef Bacik , David Sterba , Miklos Szeredi Cc: Keith Busch , Caleb Sander Mateos , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, io-uring@vger.kernel.org Subject: [PATCH] io_uring/cmd: drop unused res2 param from io_uring_cmd_done() Date: Mon, 22 Sep 2025 11:02:31 -0600 Message-ID: <20250922170234.2269956-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" Commit 79525b51acc1 ("io_uring: fix nvme's 32b cqes on mixed cq") split out a separate io_uring_cmd_done32() helper for ->uring_cmd() implementations that return 32-byte CQEs. The res2 value passed to io_uring_cmd_done() is now unused because __io_uring_cmd_done() ignores it when is_cqe32 is passed as false. So drop the parameter from io_uring_cmd_done() to simplify the callers and clarify that it's not possible to return an extra value beyond the 32-bit CQE result. Signed-off-by: Caleb Sander Mateos --- block/ioctl.c | 2 +- drivers/block/ublk_drv.c | 6 +++--- fs/btrfs/ioctl.c | 2 +- fs/fuse/dev_uring.c | 8 ++++---- include/linux/io_uring/cmd.h | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/block/ioctl.c b/block/ioctl.c index f7b0006ca45d..c9ea8e53871e 100644 --- a/block/ioctl.c +++ b/block/ioctl.c @@ -774,11 +774,11 @@ static void blk_cmd_complete(struct io_uring_cmd *cmd= , unsigned int issue_flags) struct blk_iou_cmd *bic =3D io_uring_cmd_to_pdu(cmd, struct blk_iou_cmd); =20 if (bic->res =3D=3D -EAGAIN && bic->nowait) io_uring_cmd_issue_blocking(cmd); else - io_uring_cmd_done(cmd, bic->res, 0, issue_flags); + io_uring_cmd_done(cmd, bic->res, issue_flags); } =20 static void bio_cmd_bio_end_io(struct bio *bio) { struct io_uring_cmd *cmd =3D bio->bi_private; diff --git a/drivers/block/ublk_drv.c b/drivers/block/ublk_drv.c index 99abd67b708b..48c409d1e1bb 100644 --- a/drivers/block/ublk_drv.c +++ b/drivers/block/ublk_drv.c @@ -1186,11 +1186,11 @@ static void ublk_complete_io_cmd(struct ublk_io *io= , struct request *req, int res, unsigned issue_flags) { struct io_uring_cmd *cmd =3D __ublk_prep_compl_io_cmd(io, req); =20 /* tell ublksrv one io request is coming */ - io_uring_cmd_done(cmd, res, 0, issue_flags); + io_uring_cmd_done(cmd, res, issue_flags); } =20 #define UBLK_REQUEUE_DELAY_MS 3 =20 static inline void __ublk_abort_rq(struct ublk_queue *ubq, @@ -1803,11 +1803,11 @@ static void ublk_cancel_cmd(struct ublk_queue *ubq,= unsigned tag, if (!done) io->flags |=3D UBLK_IO_FLAG_CANCELED; spin_unlock(&ubq->cancel_lock); =20 if (!done) - io_uring_cmd_done(io->cmd, UBLK_IO_RES_ABORT, 0, issue_flags); + io_uring_cmd_done(io->cmd, UBLK_IO_RES_ABORT, issue_flags); } =20 /* * The ublk char device won't be closed when calling cancel fn, so both * ublk device and queue are guaranteed to be live @@ -2450,11 +2450,11 @@ static void ublk_ch_uring_cmd_cb(struct io_uring_cm= d *cmd, unsigned int issue_flags) { int ret =3D ublk_ch_uring_cmd_local(cmd, issue_flags); =20 if (ret !=3D -EIOCBQUEUED) - io_uring_cmd_done(cmd, ret, 0, issue_flags); + io_uring_cmd_done(cmd, ret, issue_flags); } =20 static int ublk_ch_uring_cmd(struct io_uring_cmd *cmd, unsigned int issue_= flags) { if (unlikely(issue_flags & IO_URING_F_CANCEL)) { diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 7e13de2bdcbf..168d84421a78 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -4683,11 +4683,11 @@ static void btrfs_uring_read_finished(struct io_uri= ng_cmd *cmd, unsigned int iss =20 out: btrfs_unlock_extent(io_tree, priv->start, priv->lockend, &priv->cached_st= ate); btrfs_inode_unlock(inode, BTRFS_ILOCK_SHARED); =20 - io_uring_cmd_done(cmd, ret, 0, issue_flags); + io_uring_cmd_done(cmd, ret, issue_flags); add_rchar(current, ret); =20 for (index =3D 0; index < priv->nr_pages; index++) __free_page(priv->pages[index]); =20 diff --git a/fs/fuse/dev_uring.c b/fs/fuse/dev_uring.c index 249b210becb1..a30c44234a4e 100644 --- a/fs/fuse/dev_uring.c +++ b/fs/fuse/dev_uring.c @@ -349,11 +349,11 @@ static void fuse_uring_entry_teardown(struct fuse_rin= g_ent *ent) list_move(&ent->list, &queue->ent_released); ent->state =3D FRRS_RELEASED; spin_unlock(&queue->lock); =20 if (cmd) - io_uring_cmd_done(cmd, -ENOTCONN, 0, IO_URING_F_UNLOCKED); + io_uring_cmd_done(cmd, -ENOTCONN, IO_URING_F_UNLOCKED); =20 if (req) fuse_uring_stop_fuse_req_end(req); } =20 @@ -516,11 +516,11 @@ static void fuse_uring_cancel(struct io_uring_cmd *cm= d, } spin_unlock(&queue->lock); =20 if (need_cmd_done) { /* no queue lock to avoid lock order issues */ - io_uring_cmd_done(cmd, -ENOTCONN, 0, issue_flags); + io_uring_cmd_done(cmd, -ENOTCONN, issue_flags); } } =20 static void fuse_uring_prepare_cancel(struct io_uring_cmd *cmd, int issue_= flags, struct fuse_ring_ent *ring_ent) @@ -731,11 +731,11 @@ static int fuse_uring_send_next_to_ring(struct fuse_r= ing_ent *ent, ent->cmd =3D NULL; ent->state =3D FRRS_USERSPACE; list_move_tail(&ent->list, &queue->ent_in_userspace); spin_unlock(&queue->lock); =20 - io_uring_cmd_done(cmd, 0, 0, issue_flags); + io_uring_cmd_done(cmd, 0, issue_flags); return 0; } =20 /* * Make a ring entry available for fuse_req assignment @@ -1198,11 +1198,11 @@ static void fuse_uring_send(struct fuse_ring_ent *e= nt, struct io_uring_cmd *cmd, ent->state =3D FRRS_USERSPACE; list_move_tail(&ent->list, &queue->ent_in_userspace); ent->cmd =3D NULL; spin_unlock(&queue->lock); =20 - io_uring_cmd_done(cmd, ret, 0, issue_flags); + io_uring_cmd_done(cmd, ret, issue_flags); } =20 /* * This prepares and sends the ring request in fuse-uring task context. * User buffers are not mapped yet - the application does not have permiss= ion diff --git a/include/linux/io_uring/cmd.h b/include/linux/io_uring/cmd.h index 02d50f08f668..7509025b4071 100644 --- a/include/linux/io_uring/cmd.h +++ b/include/linux/io_uring/cmd.h @@ -158,13 +158,13 @@ static inline void *io_uring_cmd_ctx_handle(struct io= _uring_cmd *cmd) { return cmd_to_io_kiocb(cmd)->ctx; } =20 static inline void io_uring_cmd_done(struct io_uring_cmd *ioucmd, s32 ret, - u64 res2, unsigned issue_flags) + unsigned issue_flags) { - return __io_uring_cmd_done(ioucmd, ret, res2, issue_flags, false); + return __io_uring_cmd_done(ioucmd, ret, 0, issue_flags, false); } =20 static inline void io_uring_cmd_done32(struct io_uring_cmd *ioucmd, s32 re= t, u64 res2, unsigned issue_flags) { --=20 2.45.2