]> git.baikalelectronics.ru Git - kernel.git/commit
nvmet-fc: correct ref counting error when deferred rcv used
authorJames Smart <jsmart2021@gmail.com>
Fri, 10 Nov 2017 23:38:45 +0000 (15:38 -0800)
committerChristoph Hellwig <hch@lst.de>
Mon, 20 Nov 2017 07:38:12 +0000 (08:38 +0100)
commite7b3afef5b8c9554764e961bd75f3e48d562ed76
tree10a94ce026c096a2f40d2ec663691f153463b785
parent02f2084a1f180eb932671a9a26f424fd3a1cbcd0
nvmet-fc: correct ref counting error when deferred rcv used

Whenever a cmd is received a reference is taken while looking up the
queue. The reference is removed after the cmd is done as the iod is
returned for reuse. The fod may be reused for a deferred (recevied but
no job context) cmd.  Existing code removes the reference only if the
fod is not reused for another command. Given the fod may be used for
one or more ios, although a reference was taken per io, it won't be
matched on the frees.

Remove the reference on every fod free. This pairs the references to
each io.

Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/target/fc.c