[Devel] [PATCH RHEL7 COMMIT] ms/ixgbe: fix possible deadlock in ixgbe_service_task()

Konstantin Khorenko khorenko at virtuozzo.com
Fri Jan 10 19:09:38 MSK 2020


The commit is pushed to "branch-rh7-3.10.0-1062.7.1.vz7.130.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-1062.7.1.vz7.130.10
------>
commit fd02560557d183a96450e341ddd79ee4986eb63d
Author: Taehee Yoo <ap420073 at gmail.com>
Date:   Thu Aug 8 09:37:56 2019 -0700

    ms/ixgbe: fix possible deadlock in ixgbe_service_task()
    
    ixgbe_service_task() calls unregister_netdev() under rtnl_lock().
    But unregister_netdev() internally calls rtnl_lock().
    So deadlock would occur.
    
    Fixes: 59dd45d550c5 ("ixgbe: firmware recovery mode")
    Signed-off-by: Taehee Yoo <ap420073 at gmail.com>
    Tested-by: Andrew Bowers <andrewx.bowers at intel.com>
    Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
    Signed-off-by: David S. Miller <davem at davemloft.net>
    
    https://jira.sw.ru/browse/PSBM-100722
    
    (cherry picked from commit 8b6381600d59871fbe44d36522272f961ab42410)
    Signed-off-by: Konstantin Khorenko <khorenko at virtuozzo.com>
---
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index eb87979187cb8..eef479f762f93 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -7950,11 +7950,8 @@ static void ixgbe_service_task(struct work_struct *work)
 		return;
 	}
 	if (ixgbe_check_fw_error(adapter)) {
-		if (!test_bit(__IXGBE_DOWN, &adapter->state)) {
-			rtnl_lock();
+		if (!test_bit(__IXGBE_DOWN, &adapter->state))
 			unregister_netdev(adapter->netdev);
-			rtnl_unlock();
-		}
 		ixgbe_service_event_complete(adapter);
 		return;
 	}



More information about the Devel mailing list