• James Smart's avatar
    nvme_fcloop: disassocate local port structs · 39ede1fd
    James Smart authored
    
    [ Upstream commit 6fda2028 ]
    
    The current fcloop driver gets its lport structure from the private
    area co-allocated with the fc_localport. All is fine except the
    teardown path, which wants to wait on the completion, which is marked
    complete by the delete_localport callback performed after
    unregister_localport.  The issue is, the nvme_fc transport frees the
    localport structure immediately after delete_localport is called,
    meaning the original routine is trying to wait on a complete that
    was just freed.
    
    Change such that a lport struct is allocated coincident with the
    addition and registration of a localport. The private area of the
    localport now contains just a backpointer to the real lport struct.
    Now, the completion can be waited for, and after completing, the
    new structure can be kfree'd.
    Signed-off-by: default avatarJames Smart <james.smart@broadcom.com>
    Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
    Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    39ede1fd
fcloop.c 28.4 KB