lkml.org 
[lkml]   [2018]   [Aug]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4.14 187/217] ibmvnic: Fix error recovery on login failure
    Date
    4.14-stable review patch.  If anyone has any objections, please let me know.

    ------------------

    From: John Allen <jallen@linux.ibm.com>

    [ Upstream commit 3578a7ecb69920efc3885dbd610e98c00dbdf5db ]

    Testing has uncovered a failure case that is not handled properly. In the
    event that a login fails and we are not able to recover on the spot, we
    return 0 from do_reset, preventing any error recovery code from being
    triggered. Additionally, the state is set to "probed" meaning that when we
    are able to trigger the error recovery, the driver always comes up in the
    probed state. To handle the case properly, we need to return a failure code
    here and set the adapter state to the state that we entered the reset in
    indicating the state that we would like to come out of the recovery reset
    in.

    Signed-off-by: John Allen <jallen@linux.vnet.ibm.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    ---
    drivers/net/ethernet/ibm/ibmvnic.c | 4 ++--
    1 file changed, 2 insertions(+), 2 deletions(-)

    --- a/drivers/net/ethernet/ibm/ibmvnic.c
    +++ b/drivers/net/ethernet/ibm/ibmvnic.c
    @@ -1463,8 +1463,8 @@ static int do_reset(struct ibmvnic_adapt

    rc = ibmvnic_login(netdev);
    if (rc) {
    - adapter->state = VNIC_PROBED;
    - return 0;
    + adapter->state = reset_state;
    + return rc;
    }

    rc = reset_tx_pools(adapter);

    \
     
     \ /
      Last update: 2018-08-23 10:35    [W:2.860 / U:0.028 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site