From: Alexander Aring <alex.aring@gmail.com>
To: "Jεan Sacren" <sakiwit@gmail.com>
Cc: linux-wpan@vger.kernel.org
Subject: Re: [PATCH bluetooth-next] nl802154: fix rtnl_unlock() being missing
Date: Sat, 3 Oct 2015 08:57:05 +0200 [thread overview]
Message-ID: <20151003065703.GB7178@omega> (raw)
In-Reply-To: <20151003064413.GA7178@omega>
On Sat, Oct 03, 2015 at 08:44:13AM +0200, Alexander Aring wrote:
> Hi Jean,
>
> On Fri, Oct 02, 2015 at 10:46:52PM -0600, Jεan Sacren wrote:
> > From: Jean Sacren <sakiwit@gmail.com>
> >
> > In nl802154_prepare_wpan_dev_dump(), rtnl_unlock() was missing if it
>
> There is no rtnl_unlock missing, the rtnl_unlock call will be done by
> function "nl802154_finish_wpan_dev_dump".
>
> The rtnl lock need to be held at the full netlink _dump_ callback, e.g.:
>
> 1. call nl802154_prepare_wpan_dev_dump
>
> 2. doing netlink things
>
> 3. nl802154_finish_wpan_dev_dump
>
Actually we have something like that for the "doit" callback. In this case
netlink offers a "pre" and "post" callback for doing things before and
after the netlink call, see [0].
Maybe another idea is to have a "pre_dumpit" and "post_dumpit", but then
we need to care about dump callbacks which doesn't use
"nl802154_prepare_wpan_dev_dump" - these callbacks exist. I have not
exactly look at it and don't know how possible it is. It would be a nice
cleanup. Maybe this can be workarounded by some FLAG to do WDEV_PEPARE
or not. I don't know, just an idea. ;-)
But then do it at first in wireless subsystem. I also don't know if
the wireless community likes this idea or not.
The "pre" "post" ensures that we always handles the rtnl locks
correctly.
- Alex
[0]http://lxr.free-electrons.com/source/net/wireless/nl80211.c#L47
next prev parent reply other threads:[~2015-10-03 6:57 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-03 4:46 [PATCH bluetooth-next] nl802154: fix rtnl_unlock() being missing Jεan Sacren
2015-10-03 6:44 ` Alexander Aring
2015-10-03 6:57 ` Alexander Aring [this message]
2015-10-03 8:40 ` Jεan Sacren
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20151003065703.GB7178@omega \
--to=alex.aring@gmail.com \
--cc=linux-wpan@vger.kernel.org \
--cc=sakiwit@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).