mirror of
				https://git.proxmox.com/git/mirror_zfs.git
				synced 2025-10-26 18:05:04 +03: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 <behlendorf1@llnl.gov> Reviewed-by: Brian Atkinson <batkinson@lanl.gov> Signed-off-by: Mark Johnston <markj@FreeBSD.org> Closes #16643
This commit is contained in:
		
							parent
							
								
									1c9a4c8cb4
								
							
						
					
					
						commit
						25eb538778
					
				| @ -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 { | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Mark Johnston
						Mark Johnston