nvme/pci: Don't mark IOD as aborted if abort wasn't sent
authorKeith Busch <keith.busch@intel.com>
Tue, 24 Jan 2017 23:07:00 +0000 (18:07 -0500)
committerJens Axboe <axboe@fb.com>
Tue, 31 Jan 2017 15:34:47 +0000 (08:34 -0700)
This patch sets the aborted flag only if an abort was sent, reducing
excessive kernel message spamming for completed IO that wasn't actually
aborted.

Reported-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Keith Busch <keith.busch@intel.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Jens Axboe <axboe@fb.com>
drivers/nvme/host/pci.c

index e1b4e603b1cf7f9ee756344c08c1cf6fece2827e..06875bc1ba8025fc919899e9959c532520dd2e73 100644 (file)
@@ -898,12 +898,11 @@ static enum blk_eh_timer_return nvme_timeout(struct request *req, bool reserved)
                return BLK_EH_HANDLED;
        }
 
-       iod->aborted = 1;
-
        if (atomic_dec_return(&dev->ctrl.abort_limit) < 0) {
                atomic_inc(&dev->ctrl.abort_limit);
                return BLK_EH_RESET_TIMER;
        }
+       iod->aborted = 1;
 
        memset(&cmd, 0, sizeof(cmd));
        cmd.abort.opcode = nvme_admin_abort_cmd;