[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20080123.232651.71974261.davem@davemloft.net>
Date: Wed, 23 Jan 2008 23:26:51 -0800 (PST)
From: David Miller <davem@...emloft.net>
To: kaber@...sh.net
Cc: shemminger@...ux-foundation.org, netdev@...r.kernel.org
Subject: Re: [IPV4 3/5] fib_trie: dump doesnt use RCU
From: Patrick McHardy <kaber@...sh.net>
Date: Thu, 24 Jan 2008 07:47:39 +0100
> David Miller wrote:
> > From: Patrick McHardy <kaber@...sh.net>
> > Date: Thu, 24 Jan 2008 07:41:08 +0100
> >
> >> David Miller wrote:
> >>
> >>> and nothing in that code path retakes the RTNL semaphore.
> >>>
> >> Actually we're always holding the rtnl during dumps, nlk->cb_mutex points
> >> to rtnl_mutex in case of rtnetlink. It used to be held only during the first
> >> ->dump invocation and not on continuations, but I changed this a few
> >> versions ago.
> >>
> >
> > My bad. Thanks for the correction Patrick.
> >
> > But continuations can occur on subsequent recvmsg() calls,
> > does it return to userspace with the mutex held? If so
> > I'm pretty sure that's not allowed.
>
> No, the mutex is dropped between different ->dump invocations.
Ok, great.
This does mean, however, that the RTNL semaphore is dropped between
->dump() invocations on the same nlk->cb[] instance.
And that has implications for the shortcut Stephen is taking.
Stephen's patch assumes that during a (top-level) dump the table
cannot change. And by the above, we can only conclude that it can in
fact change between ->dump() calls for the same top-level dump run.
So the removal of the -EBUSY code block in his patch isn't valid.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists