aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/nvme/host/nvme.h
diff options
context:
space:
mode:
authorKeith Busch <keith.busch@intel.com>2016-02-24 09:15:56 -0700
committerJens Axboe <axboe@fb.com>2016-03-03 14:42:50 -0700
commit69d9a99c258eb1d6478fd9608a2070890797eed7 (patch)
treec431aebc0a314c5f84604f4bf609482df5248938 /drivers/nvme/host/nvme.h
parentNVMe: Simplify device reset failure (diff)
downloadlinux-dev-69d9a99c258eb1d6478fd9608a2070890797eed7.tar.xz
linux-dev-69d9a99c258eb1d6478fd9608a2070890797eed7.zip
NVMe: Move error handling to failed reset handler
This moves failed queue handling out of the namespace removal path and into the reset failure path, fixing a hanging condition if the controller fails or link down during del_gendisk. Previously the driver had to see the controller as degraded prior to calling del_gendisk to setup the queues to fail. But, if the controller happened to fail after this, there was no task to end outstanding requests. On failure, all namespace states are set to dead. This has capacity revalidate to 0, and ends all new requests with error status. Signed-off-by: Keith Busch <keith.busch@intel.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'drivers/nvme/host/nvme.h')
-rw-r--r--drivers/nvme/host/nvme.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/nvme/host/nvme.h b/drivers/nvme/host/nvme.h
index 4075fa9e0c34..fb15ba5f5d19 100644
--- a/drivers/nvme/host/nvme.h
+++ b/drivers/nvme/host/nvme.h
@@ -117,6 +117,7 @@ struct nvme_ns {
unsigned long flags;
#define NVME_NS_REMOVING 0
+#define NVME_NS_DEAD 1
u64 mode_select_num_blocks;
u32 mode_select_block_len;
@@ -246,6 +247,7 @@ void nvme_remove_namespaces(struct nvme_ctrl *ctrl);
void nvme_stop_queues(struct nvme_ctrl *ctrl);
void nvme_start_queues(struct nvme_ctrl *ctrl);
+void nvme_kill_queues(struct nvme_ctrl *ctrl);
struct request *nvme_alloc_request(struct request_queue *q,
struct nvme_command *cmd, unsigned int flags);