aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChuck Silvers <chs@FreeBSD.org>2022-06-22 00:54:18 +0000
committerChuck Silvers <chs@FreeBSD.org>2022-06-22 00:54:18 +0000
commit82817f26f8ecf5a3c43a8ad51737731a9b9764de (patch)
tree37fd679b1d61d60e27640336f28d2b638e2453cf
parenta4d55999dc929833d6c1450d95657b72a36e281a (diff)
downloadsrc-82817f26f8ecf5a3c43a8ad51737731a9b9764de.tar.gz
src-82817f26f8ecf5a3c43a8ad51737731a9b9764de.zip
ffs: fix vn_io_fault_pgmove() offset for PAGE_SIZE > block size
The "offset" argument to vn_io_fault_pgmove() is supposed to be the offset within the page, but for ffs we currently use the offset within the block. When the block size is at least as large as the page size then these values are the same, but when the page size is larger than the block size then we need to add the offset of the block within the page as well. Sponsored by: Netflix Reviewed by: mckusick, kib, markj Differential Revision: https://reviews.freebsd.org/D34835
-rw-r--r--sys/ufs/ffs/ffs_vnops.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c
index b57e9a3a71b0..c3f63bbfc44f 100644
--- a/sys/ufs/ffs/ffs_vnops.c
+++ b/sys/ufs/ffs/ffs_vnops.c
@@ -795,7 +795,8 @@ ffs_read(ap)
error = vn_io_fault_uiomove((char *)bp->b_data +
blkoffset, (int)xfersize, uio);
} else {
- error = vn_io_fault_pgmove(bp->b_pages, blkoffset,
+ error = vn_io_fault_pgmove(bp->b_pages,
+ blkoffset + (bp->b_offset & PAGE_MASK),
(int)xfersize, uio);
}
if (error)
@@ -947,7 +948,8 @@ ffs_write(ap)
error = vn_io_fault_uiomove((char *)bp->b_data +
blkoffset, (int)xfersize, uio);
} else {
- error = vn_io_fault_pgmove(bp->b_pages, blkoffset,
+ error = vn_io_fault_pgmove(bp->b_pages,
+ blkoffset + (bp->b_offset & PAGE_MASK),
(int)xfersize, uio);
}
/*