]> git.baikalelectronics.ru Git - kernel.git/commit
NVMe: Fix memory leak on retried commands
authorKeith Busch <keith.busch@intel.com>
Thu, 15 Oct 2015 19:38:48 +0000 (13:38 -0600)
committerJens Axboe <axboe@fb.com>
Thu, 15 Oct 2015 19:38:48 +0000 (13:38 -0600)
commited26d49c9c17c5c3c38ddabe6632ca3b88214f38
tree3ce38a73734b4a16364b1f2ba59a45df95dcdb6b
parent8ab504027d94b08d2e84ffdbf03305bd83b6145c
NVMe: Fix memory leak on retried commands

Resources are reallocated for requeued commands, so unmap and release
the iod for the failed command.

It's a pretty bad memory leak and causes a kernel hang if you remove a
drive because of a busy dma pool. You'll get messages spewing like this:

  nvme 0000:xx:xx.x: dma_pool_destroy prp list 256, ffff880420dec000 busy

and lock up pci and the driver since removal never completes while
holding a lock.

Cc: stable@vger.kernel.org
Cc: <stable@vger.kernel.org> # 4.0.x-
Signed-off-by: Keith Busch <keith.busch@intel.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@fb.com>
drivers/block/nvme-core.c