lkml.org 
[lkml]   [2010]   [Mar]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[040/145] net-sysfs: Use rtnl_trylock in wireless sysfs methods.
    2.6.32-stable review patch.  If anyone has any objections, please let me know.

    ----------------
    From: Eric W. Biederman <ebiederm@xmission.com>

    [ Upstream commit b8afe6416101549e877f8470f2a160df69676166 ]

    The wireless sysfs methods like the rest of the networking sysfs
    methods are removed with the rtnl_lock held and block until
    the existing methods stop executing. So use rtnl_trylock
    and restart_syscall so that the code continues to work.

    Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

    ---
    net/core/net-sysfs.c | 3 ++-
    1 file changed, 2 insertions(+), 1 deletion(-)

    --- a/net/core/net-sysfs.c
    +++ b/net/core/net-sysfs.c
    @@ -366,7 +366,8 @@ static ssize_t wireless_show(struct devi
    const struct iw_statistics *iw;
    ssize_t ret = -EINVAL;

    - rtnl_lock();
    + if (!rtnl_trylock())
    + return restart_syscall();
    if (dev_isalive(dev)) {
    iw = get_wireless_stats(dev);
    if (iw)



    \
     
     \ /
      Last update: 2010-03-13 02:01    [W:4.176 / U:0.372 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site