Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

io_uring/zcrx: fix post open error handling

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 <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Pavel Begunkov and committed by
Jens Axboe
5d540e45 a983aae3

+3 -6
+3 -6
io_uring/zcrx.c
··· 515 515 .mp_priv = ifq, 516 516 }; 517 517 518 - if (ifq->if_rxq == -1) 519 - return; 520 - 521 518 scoped_guard(mutex, &ifq->pp_lock) { 522 519 netdev = ifq->netdev; 523 520 netdev_tracker = ifq->netdev_tracker; ··· 522 525 } 523 526 524 527 if (netdev) { 525 - net_mp_close_rxq(netdev, ifq->if_rxq, &p); 528 + if (ifq->if_rxq != -1) 529 + net_mp_close_rxq(netdev, ifq->if_rxq, &p); 526 530 netdev_put(netdev, &netdev_tracker); 527 531 } 528 532 ifq->if_rxq = -1; ··· 831 833 } 832 834 return 0; 833 835 netdev_put_unlock: 834 - netdev_put(ifq->netdev, &ifq->netdev_tracker); 835 836 netdev_unlock(ifq->netdev); 836 837 err: 837 838 scoped_guard(mutex, &ctx->mmap_lock) 838 839 xa_erase(&ctx->zcrx_ctxs, id); 839 840 ifq_free: 840 - io_zcrx_ifq_free(ifq); 841 + zcrx_unregister(ifq); 841 842 return ret; 842 843 } 843 844