]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
nvme_fcloop: split job struct from transport for req_release
authorJames Smart <jsmart2021@gmail.com>
Tue, 11 Apr 2017 18:32:30 +0000 (11:32 -0700)
committerChristoph Hellwig <hch@lst.de>
Fri, 21 Apr 2017 14:41:50 +0000 (16:41 +0200)
commitce79bfc2c7b415f0f296adc59a54c9c781d63617
tree43e1f81149fecc2535bceee34de01f2d3f593a6e
parent19b58d9473e8e3d38e7f3602a07c8febfbd07bc1
nvme_fcloop: split job struct from transport for req_release

Current design has the fcloop job struct, used for both initiator and
target processing, allocated as part of the initiator request structure.
On aborts, the initiator side (based on the request) may terminate, yet
the target side wants to continue processing. the target side can't do
that if the initiator side goes away.
Revise fcloop to allocate an independent target side structure when it
starts an io from the initiator.

Added a lock to the request struct as well to synchronize pointer updates
on abort calls.

Modified target downcalls to recognize conditions where initiator has
aborted the io (thus nulled the pointer between job structs), thus
avoid referencing sgl lists which are gone and no longer making upcalls
to the initiator.

In conditions where the targetport is no longer connected, have the
initiator return an access failure rather than simulating a command
completion.

Signed-off-by: James Smart <james.smart@broadcom.com>
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
drivers/nvme/target/fcloop.c