zfs: try to properly handle i/o errors in mappedread_sf
Unconditionally freeing a page is not good, especially if it is the page that was wired by the caller. The checks are picked up from kern_sendfile. MFC after: 3 weeks
This commit is contained in:
parent
f9d5ea16d3
commit
aa9dd56782
@ -546,7 +546,9 @@ mappedread_sf(vnode_t *vp, int nbytes, uio_t *uio)
|
||||
vm_page_io_finish(pp);
|
||||
vm_page_lock(pp);
|
||||
if (error) {
|
||||
vm_page_free(pp);
|
||||
if (pp->wire_count == 0 && pp->valid == 0 &&
|
||||
pp->busy == 0 && !(pp->oflags & VPO_BUSY))
|
||||
vm_page_free(pp);
|
||||
} else {
|
||||
pp->valid = VM_PAGE_BITS_ALL;
|
||||
vm_page_activate(pp);
|
||||
|
Loading…
x
Reference in New Issue
Block a user