Commit 21f033f7 authored by Keith Busch's avatar Keith Busch Committed by Jens Axboe
Browse files

NVMe: Skip async events for degraded controllers



If the controller is degraded, the driver should stay out of the way so
the user can recover the drive. This patch skips driver initiated async
event requests when the drive is in this state.

Signed-off-by: default avatarKeith Busch <keith.busch@intel.com>
Reviewed-by: default avatarSagi Grimberg <sagi@grimberg.me>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarJens Axboe <axboe@fb.com>
parent 8093f7ca
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -1855,8 +1855,16 @@ static void nvme_reset_work(struct work_struct *work)
	if (result)
		goto out;

	/*
	 * A controller that can not execute IO typically requires user
	 * intervention to correct. For such degraded controllers, the driver
	 * should not submit commands the user did not request, so skip
	 * registering for asynchronous event notification on this condition.
	 */
	if (dev->online_queues > 1) {
		dev->ctrl.event_limit = NVME_NR_AEN_COMMANDS;
		queue_work(nvme_workq, &dev->async_work);
	}

	mod_timer(&dev->watchdog_timer, round_jiffies(jiffies + HZ));