aboutsummaryrefslogtreecommitdiffstats
path: root/module/os/freebsd
diff options
context:
space:
mode:
authorMark Johnston <markj@FreeBSD.org>2020-09-29 13:56:09 +0000
committerMark Johnston <markj@FreeBSD.org>2020-09-29 13:56:09 +0000
commit01ea34f1d8bc20a76845a15e968388679693ee44 (patch)
tree6bdab3bfbdb0478c34b9d4f4fc309410f4bde4ce /module/os/freebsd
parent04bab0082226f7e72c41ad528298c43edc3fa316 (diff)
downloadsrc-01ea34f1d8bc20a76845a15e968388679693ee44.tar.gz
src-01ea34f1d8bc20a76845a15e968388679693ee44.zip
Apply 0daa0320e994 ("Fix a logic bug in the FreeBSD getpages VOP")
Notes
Notes: svn path=/vendor-sys/openzfs/dist/; revision=366253
Diffstat (limited to 'module/os/freebsd')
-rw-r--r--module/os/freebsd/zfs/zfs_vnops.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/module/os/freebsd/zfs/zfs_vnops.c b/module/os/freebsd/zfs/zfs_vnops.c
index 2dde5b1f9d5c..79202b60a6f0 100644
--- a/module/os/freebsd/zfs/zfs_vnops.c
+++ b/module/os/freebsd/zfs/zfs_vnops.c
@@ -4859,7 +4859,8 @@ zfs_getpages(struct vnode *vp, vm_page_t *ma, int count, int *rbehind,
obj_size = object->un_pager.vnp.vnp_size;
zfs_vmobject_wunlock(object);
if (IDX_TO_OFF(ma[count - 1]->pindex) >= obj_size) {
- zfs_rangelock_exit(lr);
+ if (lr != NULL)
+ zfs_rangelock_exit(lr);
ZFS_EXIT(zfsvfs);
return (zfs_vm_pagerret_bad);
}
@@ -4887,7 +4888,8 @@ zfs_getpages(struct vnode *vp, vm_page_t *ma, int count, int *rbehind,
error = dmu_read_pages(os, zp->z_id, ma, count, &pgsin_b, &pgsin_a,
MIN(end, obj_size) - (end - PAGE_SIZE));
- zfs_rangelock_exit(lr);
+ if (lr != NULL)
+ zfs_rangelock_exit(lr);
ZFS_ACCESSTIME_STAMP(zfsvfs, zp);
ZFS_EXIT(zfsvfs);