From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 00C75424E78; Sat, 28 Feb 2026 17:46:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772300783; cv=none; b=d00Pvj+wrui8E0ioLwFYCm86qvLcA7CK510gBs257xVSMwwm7lCNJKX0lnwllPKIJgpUywbEORnMHRi7wH1FVcTr2DQ8T72mHtvX6GopDUX7zdTX2UCq0Wg55kRBH+bdxKVqWYrg8HDNCYPVlcJu3dhxDMcQ0d/xbAaBKJRt5pI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772300783; c=relaxed/simple; bh=uHYavhVPPsvJNwy5w2zPvNAhQLb38Qw9M/j+w5Q7EOo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=cbqruoOSDoPf1RfAUHH0/I5co/Mnzwpa2LlYCWmQEQwSeqGRJVJ5xN/JcdhZkrTUmVqXthiirMyKo4wolyBhTMgnSQV8cbyucZLDdf/vI97/P7ktpbqmtbORbdGx1ICj54NtVjGf+wTqEKSoYbwg7C3oXzOlJDG2AHidpX5vFj0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=RT2O0sxh; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="RT2O0sxh" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 49C21C19423; Sat, 28 Feb 2026 17:46:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1772300782; bh=uHYavhVPPsvJNwy5w2zPvNAhQLb38Qw9M/j+w5Q7EOo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RT2O0sxhVND+7T/SXLXsJUlZgTrLd83BfDeX1tu/lPLKU0xRxCv3Lh6a1yXd5IBWe dYoU5S5HbXw+c15FQOxMoiwLAFP5XYktR6gpU0T/M+zAlqzDOKnsSe8F+b+KR88DMH rZtp4OrcVco0Co7IEuJ5TVGqX1Bj0Tk8eB6Zpd6Viobbt/2Anahv5p3Nj4ng9AGMlF /zQZsqjz3IF7rBZrzgQ0DgTn+s4P0hrTn6e6ZWxlP+o7ssy6SHbdmzOyp2VG6oUjMN 6J2BPoILvl0o74H0Han0s4lIdFL1xBcVV7ns7hPT5lob6qnNMCmAAXpRHNi9Ru+X6I PKsqeMC7LfqRw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Pavel Begunkov , Jens Axboe , Sasha Levin Subject: [PATCH 6.19 814/844] io_uring/zcrx: fix post open error handling Date: Sat, 28 Feb 2026 12:32:07 -0500 Message-ID: <20260228173244.1509663-815-sashal@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260228173244.1509663-1-sashal@kernel.org> References: <20260228173244.1509663-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: Pavel Begunkov [ Upstream commit 5d540e4508950c674d6feef1d95463d039bbf4f5 ] Closing a queue doesn't guarantee that all associated page pools are terminated right away, let the refcounting do the work instead of releasing the zcrx ctx directly. Cc: stable@vger.kernel.org Fixes: e0793de24a9f6 ("io_uring/zcrx: set pp memory provider for an rx queue") Signed-off-by: Pavel Begunkov Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- io_uring/zcrx.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/io_uring/zcrx.c b/io_uring/zcrx.c index b133c85793c9c..84e37900c0682 100644 --- a/io_uring/zcrx.c +++ b/io_uring/zcrx.c @@ -515,9 +515,6 @@ static void io_close_queue(struct io_zcrx_ifq *ifq) .mp_priv = ifq, }; - if (ifq->if_rxq == -1) - return; - scoped_guard(mutex, &ifq->pp_lock) { netdev = ifq->netdev; netdev_tracker = ifq->netdev_tracker; @@ -525,7 +522,8 @@ static void io_close_queue(struct io_zcrx_ifq *ifq) } if (netdev) { - net_mp_close_rxq(netdev, ifq->if_rxq, &p); + if (ifq->if_rxq != -1) + net_mp_close_rxq(netdev, ifq->if_rxq, &p); netdev_put(netdev, &netdev_tracker); } ifq->if_rxq = -1; @@ -833,13 +831,12 @@ int io_register_zcrx_ifq(struct io_ring_ctx *ctx, } return 0; netdev_put_unlock: - netdev_put(ifq->netdev, &ifq->netdev_tracker); netdev_unlock(ifq->netdev); err: scoped_guard(mutex, &ctx->mmap_lock) xa_erase(&ctx->zcrx_ctxs, id); ifq_free: - io_zcrx_ifq_free(ifq); + zcrx_unregister(ifq); return ret; } -- 2.51.0