Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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()

+11 -11
+4 -7
block/blk-core.c
··· 891 891 } 892 892 893 893 /* 894 - * Non-mq queues do not honor REQ_NOWAIT, so complete a bio 895 - * with BLK_STS_AGAIN status in order to catch -EAGAIN and 896 - * to give a chance to the caller to repeat request gracefully. 894 + * For a REQ_NOWAIT based request, return -EOPNOTSUPP 895 + * if queue is not a request based queue. 897 896 */ 898 - if ((bio->bi_opf & REQ_NOWAIT) && !queue_is_mq(q)) { 899 - status = BLK_STS_AGAIN; 900 - goto end_io; 901 - } 897 + if ((bio->bi_opf & REQ_NOWAIT) && !queue_is_mq(q)) 898 + goto not_supported; 902 899 903 900 if (should_fail_bio(bio)) 904 901 goto end_io;
+7 -4
drivers/nvme/host/pci.c
··· 1382 1382 1383 1383 /* 1384 1384 * Called only on a device that has been disabled and after all other threads 1385 - * that can check this device's completion queues have synced. This is the 1386 - * last chance for the driver to see a natural completion before 1387 - * nvme_cancel_request() terminates all incomplete requests. 1385 + * that can check this device's completion queues have synced, except 1386 + * nvme_poll(). This is the last chance for the driver to see a natural 1387 + * completion before nvme_cancel_request() terminates all incomplete requests. 1388 1388 */ 1389 1389 static void nvme_reap_pending_cqes(struct nvme_dev *dev) 1390 1390 { 1391 1391 int i; 1392 1392 1393 - for (i = dev->ctrl.queue_count - 1; i > 0; i--) 1393 + for (i = dev->ctrl.queue_count - 1; i > 0; i--) { 1394 + spin_lock(&dev->queues[i].cq_poll_lock); 1394 1395 nvme_process_cq(&dev->queues[i]); 1396 + spin_unlock(&dev->queues[i].cq_poll_lock); 1397 + } 1395 1398 } 1396 1399 1397 1400 static int nvme_cmb_qdepth(struct nvme_dev *dev, int nr_io_queues,