lkml.org 
[lkml]   [2018]   [Oct]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4.14 132/137] nvme-fcloop: Fix dropped LSs to removed target port
    Date
    4.14-stable review patch.  If anyone has any objections, please let me know.

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

    From: James Smart <jsmart2021@gmail.com>

    [ Upstream commit afd299ca996929f4f98ac20da0044c0cdc124879 ]

    When a targetport is removed from the config, fcloop will avoid calling
    the LS done() routine thinking the targetport is gone. This leaves the
    initiator reset/reconnect hanging as it waits for a status on the
    Create_Association LS for the reconnect.

    Change the filter in the LS callback path. If tport null (set when
    failed validation before "sending to remote port"), be sure to call
    done. This was the main bug. But, continue the logic that only calls
    done if tport was set but there is no remoteport (e.g. case where
    remoteport has been removed, thus host doesn't expect a completion).

    Signed-off-by: James Smart <james.smart@broadcom.com>
    Signed-off-by: Christoph Hellwig <hch@lst.de>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    ---
    drivers/nvme/target/fcloop.c | 3 ++-
    1 file changed, 2 insertions(+), 1 deletion(-)

    --- a/drivers/nvme/target/fcloop.c
    +++ b/drivers/nvme/target/fcloop.c
    @@ -300,7 +300,7 @@ fcloop_tgt_lsrqst_done_work(struct work_
    struct fcloop_tport *tport = tls_req->tport;
    struct nvmefc_ls_req *lsreq = tls_req->lsreq;

    - if (tport->remoteport)
    + if (!tport || tport->remoteport)
    lsreq->done(lsreq, tls_req->status);
    }

    @@ -318,6 +318,7 @@ fcloop_ls_req(struct nvme_fc_local_port

    if (!rport->targetport) {
    tls_req->status = -ECONNREFUSED;
    + tls_req->tport = NULL;
    schedule_work(&tls_req->work);
    return ret;
    }

    \
     
     \ /
      Last update: 2018-10-02 15:47    [W:4.183 / U:0.052 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site