git: d7ae385428ae - releng/13.2 - mbuf: Fix an offset calculation in m_apply_extpg_one()
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 24 Mar 2023 23:57:02 UTC
The branch releng/13.2 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=d7ae385428ae8df4b5a39f752b389a9375597748 commit d7ae385428ae8df4b5a39f752b389a9375597748 Author: Mark Johnston <markj@FreeBSD.org> AuthorDate: 2021-11-10 21:57:12 +0000 Commit: Mark Johnston <markj@FreeBSD.org> CommitDate: 2023-03-24 23:56:47 +0000 mbuf: Fix an offset calculation in m_apply_extpg_one() We were not including the requested starting offset in the page offset. Approved by: re (cperciva) Reviewed by: jhb Fixes: 3c7a01d773ac ("Extend m_apply() to support unmapped mbufs.") Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32922 (cherry picked from commit ac2b54441742b3148de72e3b29aa0f00d29bb825) (cherry picked from commit 70421fd527e315bbc4850db2d7e80fc008393bce) --- 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 13c98d0895fa..abe292013d28 100644 --- a/sys/kern/uipc_mbuf.c +++ b/sys/kern/uipc_mbuf.c @@ -1293,7 +1293,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);