Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F102923936
D35328.id106398.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
877 B
Referenced Files
None
Subscribers
None
D35328.id106398.diff
View Options
Index: usr.sbin/bhyve/pci_nvme.c
===================================================================
--- usr.sbin/bhyve/pci_nvme.c
+++ usr.sbin/bhyve/pci_nvme.c
@@ -2171,6 +2171,7 @@
uint64_t gpaddr, size_t size, int do_write, uint64_t lba)
{
int iovidx;
+ bool range_is_contiguous;
if (req == NULL)
return (-1);
@@ -2179,8 +2180,16 @@
return (-1);
}
- /* concatenate contig block-iovs to minimize number of iovs */
- if ((req->prev_gpaddr + req->prev_size) == gpaddr) {
+ /*
+ * Minimize the number of IOVs by concatenating contiguous address
+ * ranges. Skip if there is no previous range.
+ */
+ if (req->io_req.br_iovcnt == 0)
+ range_is_contiguous = false;
+ else
+ range_is_contiguous = (req->prev_gpaddr + req->prev_size) == gpaddr;
+
+ if (range_is_contiguous) {
iovidx = req->io_req.br_iovcnt - 1;
req->io_req.br_iov[iovidx].iov_base =
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Nov 19, 7:28 PM (21 h, 36 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14722381
Default Alt Text
D35328.id106398.diff (877 B)
Attached To
Mode
D35328: bhyve nvme: Fix out-of-bound IOV array access
Attached
Detach File
Event Timeline
Log In to Comment