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 branch 'for-linus' of git://git.kernel.dk/linux-block

Pull block layer fixes from Jens Axboe:
"Three small fixes for 4.4 final. Specifically:

- The segment issue fix from Junichi, where the old IO path does a
bio limit split before potentially bouncing the pages. We need to
do that in the right order, to ensure that limitations are met.

- A NVMe surprise removal IO hang fix from Keith.

- A use-after-free in null_blk, introduced by a previous patch in
this series. From Mike Krinkin"

* 'for-linus' of git://git.kernel.dk/linux-block:
null_blk: fix use-after-free error
block: ensure to split after potentially bouncing a bio
NVMe: IO ending fixes on surprise removal

+24 -6
+2 -2
block/blk-core.c
··· 1689 1689 struct request *req; 1690 1690 unsigned int request_count = 0; 1691 1691 1692 - blk_queue_split(q, &bio, q->bio_split); 1693 - 1694 1692 /* 1695 1693 * low level driver can indicate that it wants pages above a 1696 1694 * certain limit bounced to low memory (ie for highmem, or even 1697 1695 * ISA dma in theory) 1698 1696 */ 1699 1697 blk_queue_bounce(q, &bio); 1698 + 1699 + blk_queue_split(q, &bio, q->bio_split); 1700 1700 1701 1701 if (bio_integrity_enabled(bio) && bio_integrity_prep(bio)) { 1702 1702 bio->bi_error = -EIO;
+3 -3
drivers/block/null_blk.c
··· 219 219 { 220 220 struct request_queue *q = NULL; 221 221 222 + if (cmd->rq) 223 + q = cmd->rq->q; 224 + 222 225 switch (queue_mode) { 223 226 case NULL_Q_MQ: 224 227 blk_mq_end_request(cmd->rq, 0); ··· 234 231 bio_endio(cmd->bio); 235 232 goto free_cmd; 236 233 } 237 - 238 - if (cmd->rq) 239 - q = cmd->rq->q; 240 234 241 235 /* Restart queue if needed, as we are freeing a tag */ 242 236 if (q && !q->mq_ops && blk_queue_stopped(q)) {
+19 -1
drivers/nvme/host/pci.c
··· 2540 2540 { 2541 2541 bool kill = nvme_io_incapable(ns->dev) && !blk_queue_dying(ns->queue); 2542 2542 2543 - if (kill) 2543 + if (kill) { 2544 2544 blk_set_queue_dying(ns->queue); 2545 + 2546 + /* 2547 + * The controller was shutdown first if we got here through 2548 + * device removal. The shutdown may requeue outstanding 2549 + * requests. These need to be aborted immediately so 2550 + * del_gendisk doesn't block indefinitely for their completion. 2551 + */ 2552 + blk_mq_abort_requeue_list(ns->queue); 2553 + } 2545 2554 if (ns->disk->flags & GENHD_FL_UP) 2546 2555 del_gendisk(ns->disk); 2547 2556 if (kill || !blk_queue_dying(ns->queue)) { ··· 2986 2977 { 2987 2978 struct nvme_ns *ns, *next; 2988 2979 2980 + if (nvme_io_incapable(dev)) { 2981 + /* 2982 + * If the device is not capable of IO (surprise hot-removal, 2983 + * for example), we need to quiesce prior to deleting the 2984 + * namespaces. This will end outstanding requests and prevent 2985 + * attempts to sync dirty data. 2986 + */ 2987 + nvme_dev_shutdown(dev); 2988 + } 2989 2989 list_for_each_entry_safe(ns, next, &dev->namespaces, list) 2990 2990 nvme_ns_remove(ns); 2991 2991 }