lkml.org 
[lkml]   [2018]   [Mar]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4.9 054/177] netvsc: Deal with rescinded channels correctly
    Date
    4.9-stable review patch.  If anyone has any objections, please let me know.

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

    From: "K. Y. Srinivasan" <kys@microsoft.com>


    [ Upstream commit 73e64fa4f417b22d8d5521999a631ced8e2d442e ]

    We will not be able to send packets over a channel that has been
    rescinded. Make necessary adjustments so we can properly cleanup
    even when the channel is rescinded. This issue can be trigerred
    in the NIC hot-remove path.

    Signed-off-by: K. Y. Srinivasan <kys@microsoft.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/hyperv/netvsc.c | 16 ++++++++++++++++
    1 file changed, 16 insertions(+)

    --- a/drivers/net/hyperv/netvsc.c
    +++ b/drivers/net/hyperv/netvsc.c
    @@ -151,6 +151,13 @@ static void netvsc_destroy_buf(struct hv
    sizeof(struct nvsp_message),
    (unsigned long)revoke_packet,
    VM_PKT_DATA_INBAND, 0);
    + /* If the failure is because the channel is rescinded;
    + * ignore the failure since we cannot send on a rescinded
    + * channel. This would allow us to properly cleanup
    + * even when the channel is rescinded.
    + */
    + if (device->channel->rescind)
    + ret = 0;
    /*
    * If we failed here, we might as well return and
    * have a leak rather than continue and a bugchk
    @@ -211,6 +218,15 @@ static void netvsc_destroy_buf(struct hv
    sizeof(struct nvsp_message),
    (unsigned long)revoke_packet,
    VM_PKT_DATA_INBAND, 0);
    +
    + /* If the failure is because the channel is rescinded;
    + * ignore the failure since we cannot send on a rescinded
    + * channel. This would allow us to properly cleanup
    + * even when the channel is rescinded.
    + */
    + if (device->channel->rescind)
    + ret = 0;
    +
    /* If we failed here, we might as well return and
    * have a leak rather than continue and a bugchk
    */

    \
     
     \ /
      Last update: 2018-03-23 12:30    [W:4.027 / U:0.100 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site