Skip to content

Commit 88adce4

Browse files
anguy11Jeff Kirsher
authored andcommitted
ixgbe: fix possible race in reset subtask
Similar to ixgbevf, the same possibility for race exists. Extend the RTNL lock in ixgbe_reset_subtask() to protect the state bits; this is to make sure that we get the most up-to-date values for the bits and avoid a possible race when going down. Signed-off-by: Tony Nguyen <[email protected]> Tested-by: Andrew Bowers <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
1 parent cc5b114 commit 88adce4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/net/ethernet/intel/ixgbe/ixgbe_main.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7621,17 +7621,19 @@ static void ixgbe_reset_subtask(struct ixgbe_adapter *adapter)
76217621
if (!test_and_clear_bit(__IXGBE_RESET_REQUESTED, &adapter->state))
76227622
return;
76237623

7624+
rtnl_lock();
76247625
/* If we're already down, removing or resetting, just bail */
76257626
if (test_bit(__IXGBE_DOWN, &adapter->state) ||
76267627
test_bit(__IXGBE_REMOVING, &adapter->state) ||
7627-
test_bit(__IXGBE_RESETTING, &adapter->state))
7628+
test_bit(__IXGBE_RESETTING, &adapter->state)) {
7629+
rtnl_unlock();
76287630
return;
7631+
}
76297632

76307633
ixgbe_dump(adapter);
76317634
netdev_err(adapter->netdev, "Reset adapter\n");
76327635
adapter->tx_timeout_count++;
76337636

7634-
rtnl_lock();
76357637
ixgbe_reinit_locked(adapter);
76367638
rtnl_unlock();
76377639
}

0 commit comments

Comments
 (0)