1. 12 10月, 2016 3 次提交
    • K
      nvme: don't schedule multiple resets · c5f6ce97
      Keith Busch 提交于
      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: NKeith Busch <keith.busch@intel.com>
      Reviewed-by: Sagi Grimberg<sagi@grimberg.me>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      c5f6ce97
    • K
      nvme: Delete created IO queues on reset · 70659060
      Keith Busch 提交于
      The driver was decrementing the online_queues prior to attempting to
      delete those IO queues, so the driver ended up not requesting the
      controller delete any. This patch saves the online_queues prior to
      suspending them, and adds that parameter for deleting io queues.
      
      Fixes: c21377f8 ("nvme: Suspend all queues before deletion")
      Signed-off-by: NKeith Busch <keith.busch@intel.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      70659060
    • K
      nvme: Stop probing a removed device · 0df1e4f5
      Keith Busch 提交于
      There is no reason the nvme controller can ever return all 1's from
      reading the CSTS register. This patch returns an error if we observe
      that status. Without this, we may incorrectly proceed with controller
      initialization and unnecessarilly rely on error handling to clean this.
      Signed-off-by: NKeith Busch <keith.busch@intel.com>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      0df1e4f5
  2. 08 10月, 2016 37 次提交