Merge branch 'netlink-emsgsize'
authorDavid S. Miller <davem@davemloft.net>
Wed, 6 Mar 2024 08:07:45 +0000 (08:07 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 6 Mar 2024 08:07:45 +0000 (08:07 +0000)
commit784ee615af7cfd85e62960da1d75c05df57c5a55
tree8069890c728fffcb03b85d354c5cb5b76a3b5a2c
parente3350ba4a5b7573d4e14ee1dff8c414646435a04
parent87d381973e49404f658d6923a617932eeda9415f
Merge branch 'netlink-emsgsize'

Jakub Kicinski says:

====================
netlink: handle EMSGSIZE errors in the core

Ido discovered some time back that we usually force NLMSG_DONE
to be delivered in a separate recv() syscall, even if it would
fit into the same skb as data messages. He made nexthop try
to fit DONE with data in commit 8743aeff5bc4 ("nexthop: Fix
infinite nexthop bucket dump when using maximum nexthop ID"),
and nobody has complained so far.

We have since also tried to follow the same pattern in new
genetlink families, but explaining to people, or even remembering
the correct handling ourselves is tedious.

Let the netlink socket layer consume -EMSGSIZE errors.
Practically speaking most families use this error code
as "dump needs more space", anyway.

v2:
 - init err to 0 in last patch
v1: https://lore.kernel.org/all/20240301012845.2951053-1-kuba@kernel.org/
====================

Signed-off-by: David S. Miller <davem@davemloft.net>