# 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 
- List: netdev
- Page: https://ratatoskr.run/netdev/2015/01/10975786
- Thread: https://ratatoskr.run/netdev/2015/01/10975759/t.md

```text
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.
```
