aboutsummaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorMark Johnston <[email protected]>2022-04-07 17:13:18 -0400
committerBrian Behlendorf <[email protected]>2022-04-19 10:42:54 -0700
commitb7546f92eaeb295cf0302662773792a2a8d359a5 (patch)
treef87ceae374cc874608af40fbebe001ad85964405 /module
parente9cd90f6e5953df79ae5db84e3b23f339d6098f7 (diff)
FreeBSD: Return Mach error codes from VOP_(GET|PUT)PAGES
FreeBSD's memory management system uses its own error numbers and gets confused when these VOPs return EIO. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Ryan Moeller <[email protected]> Reported-by: Peter Holm <[email protected]> Signed-off-by: Mark Johnston <[email protected]> Closes #13311
Diffstat (limited to 'module')
-rw-r--r--module/os/freebsd/zfs/zfs_vnops_os.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/module/os/freebsd/zfs/zfs_vnops_os.c b/module/os/freebsd/zfs/zfs_vnops_os.c
index 75a4fd183..d273e7098 100644
--- a/module/os/freebsd/zfs/zfs_vnops_os.c
+++ b/module/os/freebsd/zfs/zfs_vnops_os.c
@@ -4062,8 +4062,8 @@ zfs_getpages(struct vnode *vp, vm_page_t *ma, int count, int *rbehind,
int pgsin_b, pgsin_a;
int error;
- ZFS_ENTER(zfsvfs);
- ZFS_VERIFY_ZP(zp);
+ ZFS_ENTER_ERROR(zfsvfs, zfs_vm_pagerret_error);
+ ZFS_VERIFY_ZP_ERROR(zp, zfs_vm_pagerret_error);
start = IDX_TO_OFF(ma[0]->pindex);
end = IDX_TO_OFF(ma[count - 1]->pindex + 1);
@@ -4187,19 +4187,18 @@ zfs_putpages(struct vnode *vp, vm_page_t *ma, size_t len, int flags,
int err;
int i;
- ZFS_ENTER(zfsvfs);
- ZFS_VERIFY_ZP(zp);
-
object = vp->v_object;
- pcount = btoc(len);
- ncount = pcount;
-
KASSERT(ma[0]->object == object, ("mismatching object"));
KASSERT(len > 0 && (len & PAGE_MASK) == 0, ("unexpected length"));
+ pcount = btoc(len);
+ ncount = pcount;
for (i = 0; i < pcount; i++)
rtvals[i] = zfs_vm_pagerret_error;
+ ZFS_ENTER_ERROR(zfsvfs, zfs_vm_pagerret_error);
+ ZFS_VERIFY_ZP_ERROR(zp, zfs_vm_pagerret_error);
+
off = IDX_TO_OFF(ma[0]->pindex);
blksz = zp->z_blksz;
lo_off = rounddown(off, blksz);