[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1457948108-24837-1-git-send-email-roy.qing.li@gmail.com>
Date: Mon, 14 Mar 2016 17:35:08 +0800
From: roy.qing.li@...il.com
To: netdev@...r.kernel.org
Subject: [PATCH][net-next] ipv6: replace write lock with read lock in addrconf_permanent_addr
From: Li RongQing <roy.qing.li@...il.com>
nothing of idev is changed, so read lock is enough
Signed-off-by: Li RongQing <roy.qing.li@...il.com>
---
net/ipv6/addrconf.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 8c0dab2..d3f0d87 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -3228,21 +3228,21 @@ static void addrconf_permanent_addr(struct net_device *dev)
if (!idev)
return;
- write_lock_bh(&idev->lock);
+ read_lock_bh(&idev->lock);
list_for_each_entry_safe(ifp, tmp, &idev->addr_list, if_list) {
if ((ifp->flags & IFA_F_PERMANENT) &&
fixup_permanent_addr(idev, ifp) < 0) {
- write_unlock_bh(&idev->lock);
+ read_unlock_bh(&idev->lock);
ipv6_del_addr(ifp);
- write_lock_bh(&idev->lock);
+ read_lock_bh(&idev->lock);
net_info_ratelimited("%s: Failed to add prefix route for address %pI6c; dropping\n",
idev->dev->name, &ifp->addr);
}
}
- write_unlock_bh(&idev->lock);
+ read_unlock_bh(&idev->lock);
}
static int addrconf_notify(struct notifier_block *this, unsigned long event,
--
2.1.4
Powered by blists - more mailing lists