Page pool ensures the cache is empty before asking to refill it. Warn if
the assumption is violated.
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
---
io_uring/zcrx.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/io_uring/zcrx.c b/io_uring/zcrx.c
index b4352c7b2d84..04718a3f2831 100644
--- a/io_uring/zcrx.c
+++ b/io_uring/zcrx.c
@@ -1073,8 +1073,8 @@ static netmem_ref io_pp_zc_alloc_netmems(struct page_pool *pp, gfp_t gfp)
struct io_zcrx_ifq *ifq = io_pp_to_ifq(pp);
/* pp should already be ensuring that */
- if (unlikely(pp->alloc.count))
- goto out_return;
+ if (WARN_ON_ONCE(pp->alloc.count))
+ return 0;
io_zcrx_ring_refill(pp, ifq);
if (likely(pp->alloc.count))
--
2.53.0