diff options
author | avg <avg@FreeBSD.org> | 2013-07-09 08:47:11 +0000 |
---|---|---|
committer | avg <avg@FreeBSD.org> | 2013-07-09 08:47:11 +0000 |
commit | aa9dd56782a20f5d5a87859acf27f149c9f6ba56 (patch) | |
tree | 65155ff8f2fb073597f92e6c0164baef70571697 /sys/cddl | |
parent | f9d5ea16d37a7279d1235b618cac0e3263f8a03d (diff) | |
download | FreeBSD-src-aa9dd56782a20f5d5a87859acf27f149c9f6ba56.zip FreeBSD-src-aa9dd56782a20f5d5a87859acf27f149c9f6ba56.tar.gz |
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
Diffstat (limited to 'sys/cddl')
-rw-r--r-- | sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c index d949acb..775fbb4 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c @@ -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); |