Commit 75574f12 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'block-5.7-2020-05-29' of git://git.kernel.dk/linux-block

Pull block fixes from Jens Axboe:
 "Two small fixes:

   - Revert a block change that mixed up the return values for non-mq
     devices

   - NVMe poll race fix"

* tag 'block-5.7-2020-05-29' of git://git.kernel.dk/linux-block:
  Revert "block: end bio with BLK_STS_AGAIN in case of non-mq devs and REQ_NOWAIT"
  nvme-pci: avoid race between nvme_reap_pending_cqes() and nvme_poll()
parents 6ff64d25 b0beb280
...@@ -891,14 +891,11 @@ generic_make_request_checks(struct bio *bio) ...@@ -891,14 +891,11 @@ generic_make_request_checks(struct bio *bio)
} }
/* /*
* Non-mq queues do not honor REQ_NOWAIT, so complete a bio * For a REQ_NOWAIT based request, return -EOPNOTSUPP
* with BLK_STS_AGAIN status in order to catch -EAGAIN and * if queue is not a request based queue.
* to give a chance to the caller to repeat request gracefully.
*/ */
if ((bio->bi_opf & REQ_NOWAIT) && !queue_is_mq(q)) { if ((bio->bi_opf & REQ_NOWAIT) && !queue_is_mq(q))
status = BLK_STS_AGAIN; goto not_supported;
goto end_io;
}
if (should_fail_bio(bio)) if (should_fail_bio(bio))
goto end_io; goto end_io;
......
...@@ -1382,16 +1382,19 @@ static void nvme_disable_admin_queue(struct nvme_dev *dev, bool shutdown) ...@@ -1382,16 +1382,19 @@ static void nvme_disable_admin_queue(struct nvme_dev *dev, bool shutdown)
/* /*
* Called only on a device that has been disabled and after all other threads * Called only on a device that has been disabled and after all other threads
* that can check this device's completion queues have synced. This is the * that can check this device's completion queues have synced, except
* last chance for the driver to see a natural completion before * nvme_poll(). This is the last chance for the driver to see a natural
* nvme_cancel_request() terminates all incomplete requests. * completion before nvme_cancel_request() terminates all incomplete requests.
*/ */
static void nvme_reap_pending_cqes(struct nvme_dev *dev) static void nvme_reap_pending_cqes(struct nvme_dev *dev)
{ {
int i; int i;
for (i = dev->ctrl.queue_count - 1; i > 0; i--) for (i = dev->ctrl.queue_count - 1; i > 0; i--) {
spin_lock(&dev->queues[i].cq_poll_lock);
nvme_process_cq(&dev->queues[i]); nvme_process_cq(&dev->queues[i]);
spin_unlock(&dev->queues[i].cq_poll_lock);
}
} }
static int nvme_cmb_qdepth(struct nvme_dev *dev, int nr_io_queues, static int nvme_cmb_qdepth(struct nvme_dev *dev, int nr_io_queues,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment