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 fixes from Jens Axboe:
"Four small fixes.

Three of them fix the same error in NVMe, in loop, fc, and rdma
respectively. The last fix from Ming fixes a regression in this
series, where our bvec gap logic was wrong and causes an oops on
NVMe for certain conditions"

* 'for-linus' of git://git.kernel.dk/linux-block:
block: fix bio_will_gap() for first bvec with offset
nvme-fc: Fix sqsize wrong assignment based on ctrl MQES capability
nvme-rdma: Fix sqsize wrong assignment based on ctrl MQES capability
nvme-loop: Fix sqsize wrong assignment based on ctrl MQES capability

+31 -7
+1 -1
drivers/nvme/host/fc.c
··· 2023 2023 } 2024 2024 2025 2025 ctrl->ctrl.sqsize = 2026 - min_t(int, NVME_CAP_MQES(ctrl->cap) + 1, ctrl->ctrl.sqsize); 2026 + min_t(int, NVME_CAP_MQES(ctrl->cap), ctrl->ctrl.sqsize); 2027 2027 2028 2028 error = nvme_enable_ctrl(&ctrl->ctrl, ctrl->cap); 2029 2029 if (error)
+1 -1
drivers/nvme/host/rdma.c
··· 1606 1606 } 1607 1607 1608 1608 ctrl->ctrl.sqsize = 1609 - min_t(int, NVME_CAP_MQES(ctrl->cap) + 1, ctrl->ctrl.sqsize); 1609 + min_t(int, NVME_CAP_MQES(ctrl->cap), ctrl->ctrl.sqsize); 1610 1610 1611 1611 error = nvme_enable_ctrl(&ctrl->ctrl, ctrl->cap); 1612 1612 if (error)
+1 -1
drivers/nvme/target/loop.c
··· 392 392 } 393 393 394 394 ctrl->ctrl.sqsize = 395 - min_t(int, NVME_CAP_MQES(ctrl->cap) + 1, ctrl->ctrl.sqsize); 395 + min_t(int, NVME_CAP_MQES(ctrl->cap), ctrl->ctrl.sqsize); 396 396 397 397 error = nvme_enable_ctrl(&ctrl->ctrl, ctrl->cap); 398 398 if (error)
+28 -4
include/linux/blkdev.h
··· 1672 1672 return true; 1673 1673 } 1674 1674 1675 - static inline bool bio_will_gap(struct request_queue *q, struct bio *prev, 1676 - struct bio *next) 1675 + static inline bool bio_will_gap(struct request_queue *q, 1676 + struct request *prev_rq, 1677 + struct bio *prev, 1678 + struct bio *next) 1677 1679 { 1678 1680 if (bio_has_data(prev) && queue_virt_boundary(q)) { 1679 1681 struct bio_vec pb, nb; 1680 1682 1683 + /* 1684 + * don't merge if the 1st bio starts with non-zero 1685 + * offset, otherwise it is quite difficult to respect 1686 + * sg gap limit. We work hard to merge a huge number of small 1687 + * single bios in case of mkfs. 1688 + */ 1689 + if (prev_rq) 1690 + bio_get_first_bvec(prev_rq->bio, &pb); 1691 + else 1692 + bio_get_first_bvec(prev, &pb); 1693 + if (pb.bv_offset) 1694 + return true; 1695 + 1696 + /* 1697 + * We don't need to worry about the situation that the 1698 + * merged segment ends in unaligned virt boundary: 1699 + * 1700 + * - if 'pb' ends aligned, the merged segment ends aligned 1701 + * - if 'pb' ends unaligned, the next bio must include 1702 + * one single bvec of 'nb', otherwise the 'nb' can't 1703 + * merge with 'pb' 1704 + */ 1681 1705 bio_get_last_bvec(prev, &pb); 1682 1706 bio_get_first_bvec(next, &nb); 1683 1707 ··· 1714 1690 1715 1691 static inline bool req_gap_back_merge(struct request *req, struct bio *bio) 1716 1692 { 1717 - return bio_will_gap(req->q, req->biotail, bio); 1693 + return bio_will_gap(req->q, req, req->biotail, bio); 1718 1694 } 1719 1695 1720 1696 static inline bool req_gap_front_merge(struct request *req, struct bio *bio) 1721 1697 { 1722 - return bio_will_gap(req->q, bio, req->bio); 1698 + return bio_will_gap(req->q, NULL, bio, req->bio); 1723 1699 } 1724 1700 1725 1701 int kblockd_schedule_work(struct work_struct *work);