diff options
author | gavin <gavin@FreeBSD.org> | 2013-06-28 07:51:12 +0000 |
---|---|---|
committer | gavin <gavin@FreeBSD.org> | 2013-06-28 07:51:12 +0000 |
commit | e3d9c74722929192746e08f01762ff752e3fa532 (patch) | |
tree | 280aaef3fd5040315e2c1a7b7955e654044580ef /sys/cddl | |
parent | be00d9ee47370d08f51a67ae725a037473072133 (diff) | |
download | FreeBSD-src-e3d9c74722929192746e08f01762ff752e3fa532.zip FreeBSD-src-e3d9c74722929192746e08f01762ff752e3fa532.tar.gz |
Don't try to re-insert an already present but invalid page.
This could happen if a thread doing a page-in loses a ZFS range lock
race to a thread writing to the same range
This fixes "panic: vm_page_alloc: pindex already allocated" in
http://docs.FreeBSD.org/cgi/mid.cgi?1372165971.96049.42.camel
Submitted by: avg
MFC after: 1 week
Diffstat (limited to 'sys/cddl')
-rw-r--r-- | sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c | 5 |
1 files changed, 4 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 c5b55ed..d949acb 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 @@ -345,10 +345,13 @@ page_busy(vnode_t *vp, int64_t start, int64_t off, int64_t nbytes) vm_page_sleep(pp, "zfsmwb"); continue; } - } else { + } else if (pp == NULL) { pp = vm_page_alloc(obj, OFF_TO_IDX(start), VM_ALLOC_SYSTEM | VM_ALLOC_IFCACHED | VM_ALLOC_NOBUSY); + } else { + ASSERT(pp != NULL && !pp->valid); + pp = NULL; } if (pp != NULL) { |