]> git.baikalelectronics.ru Git - kernel.git/commit
nvme_fcloop: fix abort race condition
authorJames Smart <jsmart2021@gmail.com>
Thu, 30 Nov 2017 00:47:30 +0000 (16:47 -0800)
committerChristoph Hellwig <hch@lst.de>
Mon, 8 Jan 2018 10:01:53 +0000 (11:01 +0100)
commitc8aac4cfbf915fee52b05a68aaee3a311683a993
tree8bbb60c518b3ea73bc14e8848acff1e3acd969a9
parent9816abb71b8bd94fe17eb0c58d467d1a723e9e6f
nvme_fcloop: fix abort race condition

A test case revealed a race condition of an i/o completing on a thread
parallel to the delete_association generating the aborts for the
outstanding ios on the controller.  The i/o completion was freeing the
target fcloop context, thus the abort task referenced the just-freed
memory.

Correct by clearing the target/initiator cross pointers in the io
completion and abort tasks before calling the callbacks. On aborts
that detect already finished io's, ensure the complete context is
called.

Signed-off-by: James Smart <james.smart@broadcom.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/target/fcloop.c