svn commit: r253073 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

Andriy Gapon avg at FreeBSD.org
Tue Jul 9 08:47:11 UTC 2013


Author: avg
Date: Tue Jul  9 08:47:11 2013
New Revision: 253073
URL: http://svnweb.freebsd.org/changeset/base/253073

Log:
  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

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c	Tue Jul  9 08:42:02 2013	(r253072)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c	Tue Jul  9 08:47:11 2013	(r253073)
@@ -546,7 +546,9 @@ mappedread_sf(vnode_t *vp, int nbytes, u
 			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);


More information about the svn-src-head mailing list