Re: [PATCH bluetooth-next] nl802154: fix rtnl_unlock() being missing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
> > 
> > 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
--
To unsubscribe from this list: send the line "unsubscribe linux-wpan" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux