Thread (5 messages) 5 messages, 2 authors, 2018-01-22

Re: [PATCH v3 3/5] mac80211_hwsim: add generation count for netlink dump operation

From: Johannes Berg <johannes@sipsolutions.net>
Date: 2018-01-22 13:24:15

On Mon, 2018-01-15 at 15:28 +0100, Benjamin Beichler wrote:
Am 15.01.2018 um 13:08 schrieb Johannes Berg:
quoted
On Wed, 2018-01-10 at 17:42 +0100, Benjamin Beichler wrote:
quoted
 Change the dump iteration to be independent from
increasing radio indices on radio list.
You can't do that, data structures can be deleted while the dump is
ongoing.
That's what I try to address with this patch. In the past there were
corner cases, which might have failed while deletion.
Hah, ok.
Nonetheless, the radio count is in the current version strictly
monotonic, maybe the description is misleading. :-)
So in the inner loop there is no deletion possible because of the
spinlock, and multiple calls of nl_dump check the generation count and
cancel if it have changed.
Ah, I missed that you cancel when it's changed, we don't usually do
that normally.

I'd still prefer if you could have the code not rely on the pointers,
because if somebody gets it wrong (forgets to update the generation
count) I'm not sure I want that to crash in some corner cases...

johannes
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help