git: ac2b54441742 - main - mbuf: Fix an offset calculation in m_apply_extpg_one()
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 10 Nov 2021 21:58:35 UTC
The branch main has been updated by markj:
URL: https://cgit.FreeBSD.org/src/commit/?id=ac2b54441742b3148de72e3b29aa0f00d29bb825
commit ac2b54441742b3148de72e3b29aa0f00d29bb825
Author: Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2021-11-10 21:57:12 +0000
Commit: Mark Johnston <markj@FreeBSD.org>
CommitDate: 2021-11-10 21:57:12 +0000
mbuf: Fix an offset calculation in m_apply_extpg_one()
We were not including the requested starting offset in the page offset.
Reviewed by: jhb
Fixes: 3c7a01d773ac ("Extend m_apply() to support unmapped mbufs.")
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32922
---
sys/kern/uipc_mbuf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c
index 0196023bc601..e0cb45a8d384 100644
--- a/sys/kern/uipc_mbuf.c
+++ b/sys/kern/uipc_mbuf.c
@@ -1301,7 +1301,7 @@ m_apply_extpg_one(struct mbuf *m, int off, int len,
pglen = m_epg_pagelen(m, i, pgoff);
if (off < pglen) {
count = min(pglen - off, len);
- p = (void *)PHYS_TO_DMAP(m->m_epg_pa[i] + pgoff);
+ p = (void *)PHYS_TO_DMAP(m->m_epg_pa[i] + pgoff + off);
rval = f(arg, p, count);
if (rval)
return (rval);