mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-10-30 04:15:06 +01:00
Fix a potential page leak in mappedread_sf()
mappedread_sf() may allocate pages; if it fails to populate a page can't free it, it needs to ensure that it's placed into a page queue, otherwise it can't be reclaimed until the vnode is destroyed. I think this is quite unlikely to happen in practice, it was noticed by code inspection. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Brian Atkinson <[email protected]> Signed-off-by: Mark Johnston <[email protected]> Closes #16643
This commit is contained in:
1 parent
1c9a4c8cb4
commit
25eb538778
1 file changed
+3
-1
@@ -452,8 +452,10 @@ mappedread_sf(znode_t *zp, int nbytes, zfs_uio_t *uio)
|
||||
if (!vm_page_wired(pp) && pp->valid == 0 &&
|
||||
vm_page_busy_tryupgrade(pp))
|
||||
vm_page_free(pp);
|
||||
else
|
||||
else {
|
||||
vm_page_deactivate_noreuse(pp);
|
||||
vm_page_sunbusy(pp);
|
||||
}
|
||||
zfs_vmobject_wunlock(obj);
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in new issue
Block a user