Re: [PATCH 3/3] netlink: Lock out table resizes while dumping Netlink sockets

From
Thomas Graf <tgraf@suug.ch>
Date
2015-01-20 15:35:56
Also in
netfilter-devel
Reply to
Patrick McHardy, 2015-01-20
On 01/20/15 at 03:21pm, Patrick McHardy wrote:
I think its preferrable to make the need to handle NETLINK_F_DUMP_INTR
as noticable as possible and not hide it. Silent failure is the worst
kind of failure.
I agree to that. The point here is to avoid unnecessary use of
NETLINK_F_DUMP_INTR if all entries fit into a single message buffer.
 
Yeah. The point could be made that this is a regression though. We didn't
require userspace to deal with interruptions before, and the behaviour
was well defined and acceptable for most cases, its not anymore.

So I think it should be handled by the kernel, without changes to
userspace.
nl_table_lock was released between individual messages just like
ht->mutex is released with this change.

What changed is that inserts and removal can now occur *while* the
message is being constructed whereas previously they could only
occur between message construction periods. In either case, the dump
would end up missing entries or showing duplicates.
Thread (79 messages) 79 messages, 6 authors, last reply 2015-02-03
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help