summaryrefslogtreecommitdiffstats
path: root/crypto/ecdh_helper.c
diff options
context:
space:
mode:
authorKeith Busch <keith.busch@intel.com>2016-10-05 16:32:45 -0400
committerJens Axboe <axboe@fb.com>2016-10-12 09:24:39 -0600
commitc5f6ce97c12104668784ee17fb927c52a944d3d8 (patch)
tree863e6e0ce1eff4684788e8214d43224ba80bd3e8 /crypto/ecdh_helper.c
parent7065906096273b39b90a512a7170a6697ed94b23 (diff)
downloadblackbird-op-linux-c5f6ce97c12104668784ee17fb927c52a944d3d8.tar.gz
blackbird-op-linux-c5f6ce97c12104668784ee17fb927c52a944d3d8.zip
nvme: don't schedule multiple resets
The queue_work only fails if the work is pending, but not yet running. If the work is running, the work item would get requeued, triggering a double reset. If the first reset fails for any reason, the second reset triggers: WARN_ON(dev->ctrl.state == NVME_CTRL_RESETTING) Hitting that schedules controller deletion for a second time, which potentially takes a reference on the device that is being deleted. If the reset occurs at the same time as a hot removal event, this causes a double-free. This patch has the reset helper function check if the work is busy prior to queueing, and changes all places that schedule resets to use this function. Since most users don't want to sync with that work, the "flush_work" is moved to the only caller that wants to sync. Signed-off-by: Keith Busch <keith.busch@intel.com> Reviewed-by: Sagi Grimberg<sagi@grimberg.me> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'crypto/ecdh_helper.c')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud