From: Jens Axboe Date: Mon, 12 Dec 2016 01:31:01 +0000 (-0700) Subject: Merge branch 'for-4.10/block' into for-4.10/merge X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=refs%2Fheads%2Ffor-4.10%2Fmerge;p=linux-2.6-block.git Merge branch 'for-4.10/block' into for-4.10/merge Signed-off-by: Jens Axboe --- d3f9ece8a0dec77775ae0f62e4389a1eb7357ad7 diff --cc block/blk-flush.c index 3c882cbc7541,27a42dab5a36..20b7c7a02f1c --- a/block/blk-flush.c +++ b/block/blk-flush.c @@@ -342,34 -340,6 +340,34 @@@ static void flush_data_end_io(struct re struct request_queue *q = rq->q; struct blk_flush_queue *fq = blk_get_flush_queue(q, NULL); + /* + * Updating q->in_flight[] here for making this tag usable + * early. Because in blk_queue_start_tag(), + * q->in_flight[BLK_RW_ASYNC] is used to limit async I/O and + * reserve tags for sync I/O. + * + * More importantly this way can avoid the following I/O + * deadlock: + * + * - suppose there are 40 fua requests comming to flush queue + * and queue depth is 31 + * - 30 rqs are scheduled then blk_queue_start_tag() can't alloc + * tag for async I/O any more + * - all the 30 rqs are completed before FLUSH_PENDING_TIMEOUT + * and flush_data_end_io() is called + * - the other rqs still can't go ahead if not updating + * q->in_flight[BLK_RW_ASYNC] here, meantime these rqs + * are held in flush data queue and make no progress of + * handling post flush rq + * - only after the post flush rq is handled, all these rqs + * can be completed + */ + + elv_completed_request(q, rq); + + /* for avoiding double accounting */ - rq->cmd_flags &= ~REQ_STARTED; ++ rq->rq_flags &= ~RQF_STARTED; + /* * After populating an empty queue, kick it to avoid stall. Read * the comment in flush_end_io(). diff --cc include/linux/nvme.h index fc3c24206593,5ac1f57226f4..3d1c6f1b15c9 --- a/include/linux/nvme.h +++ b/include/linux/nvme.h @@@ -970,9 -961,21 +990,22 @@@ enum NVME_SC_REFTAG_CHECK = 0x284, NVME_SC_COMPARE_FAILED = 0x285, NVME_SC_ACCESS_DENIED = 0x286, + NVME_SC_UNWRITTEN_BLOCK = 0x287, NVME_SC_DNR = 0x4000, + + + /* + * FC Transport-specific error status values for NVME commands + * + * Transport-specific status code values must be in the range 0xB0..0xBF + */ + + /* Generic FC failure - catchall */ + NVME_SC_FC_TRANSPORT_ERROR = 0x00B0, + + /* I/O failure due to FC ABTS'd */ + NVME_SC_FC_TRANSPORT_ABORTED = 0x00B1, }; struct nvme_completion {