lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1325643618-3051-1-git-send-email-maxim.uvarov@oracle.com>
Date:	Tue,  3 Jan 2012 18:20:18 -0800
From:	Maxim Uvarov <maxim.uvarov@...cle.com>
To:	netdev@...r.kernel.org
Cc:	Maxim Uvarov <maxim.uvarov@...cle.com>
Subject: [PATCH] bond_alb: do not disable BH under netpoll

Do not disable BH if interrupts are already disabled
(netpoll case).
Signed-off-by: Maxim Uvarov <maxim.uvarov@...cle.com>
---
 drivers/net/bonding/bond_alb.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c
index d4fbd2e..69eeb36 100644
--- a/drivers/net/bonding/bond_alb.c
+++ b/drivers/net/bonding/bond_alb.c
@@ -101,12 +101,18 @@ static inline u8 _simple_hash(const u8 *hash_start, int hash_size)
 
 static inline void _lock_tx_hashtbl(struct bonding *bond)
 {
-	spin_lock_bh(&(BOND_ALB_INFO(bond).tx_hashtbl_lock));
+	if (unlikely(irqs_disabled())) /*netpoll case*/
+		spin_lock(&(BOND_ALB_INFO(bond).tx_hashtbl_lock));
+	else
+		spin_lock_bh(&(BOND_ALB_INFO(bond).tx_hashtbl_lock));
 }
 
 static inline void _unlock_tx_hashtbl(struct bonding *bond)
 {
-	spin_unlock_bh(&(BOND_ALB_INFO(bond).tx_hashtbl_lock));
+	if (unlikely(irqs_disabled())) /*netpoll case*/
+		spin_unlock(&(BOND_ALB_INFO(bond).tx_hashtbl_lock));
+	else
+		spin_unlock_bh(&(BOND_ALB_INFO(bond).tx_hashtbl_lock));
 }
 
 /* Caller must hold tx_hashtbl lock */
-- 
1.7.4.1

--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ