diff mbox series

[net] page_pool: fix netlink dump stop/resume

Message ID 20240301011331.2945115-1-kuba@kernel.org (mailing list archive)
State Accepted
Commit 429679dcf7d918b7bb523d89bde3307fb02496c3
Delegated to: Netdev Maintainers
Headers show
Series [net] page_pool: fix netlink dump stop/resume | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag present in non-next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 958 this patch: 958
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 5 of 5 maintainers
netdev/build_clang success Errors and warnings before: 973 this patch: 973
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 974 this patch: 974
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 13 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-03-03--15-00 (tests: 886)

Commit Message

Jakub Kicinski March 1, 2024, 1:13 a.m. UTC
If message fills up we need to stop writing. 'break' will
only get us out of the iteration over pools of a single
netdev, we need to also stop walking netdevs.

This results in either infinite dump, or missing pools,
depending on whether message full happens on the last
netdev (infinite dump) or non-last (missing pools).

Fixes: 950ab53b77ab ("net: page_pool: implement GET in the netlink API")
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
CC: hawk@kernel.org
---
 net/core/page_pool_user.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Eric Dumazet March 1, 2024, 8:43 a.m. UTC | #1
On Fri, Mar 1, 2024 at 2:13 AM Jakub Kicinski <kuba@kernel.org> wrote:
>
> If message fills up we need to stop writing. 'break' will
> only get us out of the iteration over pools of a single
> netdev, we need to also stop walking netdevs.
>
> This results in either infinite dump, or missing pools,
> depending on whether message full happens on the last
> netdev (infinite dump) or non-last (missing pools).
>
> Fixes: 950ab53b77ab ("net: page_pool: implement GET in the netlink API")
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Reviewed-by: Eric Dumazet <edumazet@google.com>
patchwork-bot+netdevbpf@kernel.org March 4, 2024, 10:20 a.m. UTC | #2
Hello:

This patch was applied to netdev/net.git (main)
by David S. Miller <davem@davemloft.net>:

On Thu, 29 Feb 2024 17:13:31 -0800 you wrote:
> If message fills up we need to stop writing. 'break' will
> only get us out of the iteration over pools of a single
> netdev, we need to also stop walking netdevs.
> 
> This results in either infinite dump, or missing pools,
> depending on whether message full happens on the last
> netdev (infinite dump) or non-last (missing pools).
> 
> [...]

Here is the summary with links:
  - [net] page_pool: fix netlink dump stop/resume
    https://git.kernel.org/netdev/net/c/429679dcf7d9

You are awesome, thank you!
diff mbox series

Patch

diff --git a/net/core/page_pool_user.c b/net/core/page_pool_user.c
index ffe5244e5597..278294aca66a 100644
--- a/net/core/page_pool_user.c
+++ b/net/core/page_pool_user.c
@@ -94,11 +94,12 @@  netdev_nl_page_pool_get_dump(struct sk_buff *skb, struct netlink_callback *cb,
 			state->pp_id = pool->user.id;
 			err = fill(skb, pool, info);
 			if (err)
-				break;
+				goto out;
 		}
 
 		state->pp_id = 0;
 	}
+out:
 	mutex_unlock(&page_pools_lock);
 	rtnl_unlock();