diff options
author | alc <alc@FreeBSD.org> | 2015-04-05 20:07:33 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2015-04-05 20:07:33 +0000 |
commit | 702869582918c86494e3b54b1cab4f4aa4eb2a84 (patch) | |
tree | 997fb14e1a44ffb343f12f07246f6b99ec1158be | |
parent | ed54a77a55fed97cc5e8ddebceed353d46f52a7a (diff) | |
download | FreeBSD-src-702869582918c86494e3b54b1cab4f4aa4eb2a84.zip FreeBSD-src-702869582918c86494e3b54b1cab4f4aa4eb2a84.tar.gz |
Until the lock assertions in vm_page_advise() are properly reevaluated,
vm_fault_dontneed() should acquire a write lock on the first object in
the shadow chain.
Reported by: gleb, David Wolfskill
-rw-r--r-- | sys/vm/vm_fault.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/vm/vm_fault.c b/sys/vm/vm_fault.c index 5ee6d25..13f46e1 100644 --- a/sys/vm/vm_fault.c +++ b/sys/vm/vm_fault.c @@ -1060,9 +1060,9 @@ vm_fault_dontneed(const struct faultstate *fs, vm_offset_t vaddr, int ahead) VM_OBJECT_ASSERT_WLOCKED(object); first_object = fs->first_object; if (first_object != object) { - if (!VM_OBJECT_TRYRLOCK(first_object)) { + if (!VM_OBJECT_TRYWLOCK(first_object)) { VM_OBJECT_WUNLOCK(object); - VM_OBJECT_RLOCK(first_object); + VM_OBJECT_WLOCK(first_object); VM_OBJECT_WLOCK(object); } } @@ -1097,7 +1097,7 @@ vm_fault_dontneed(const struct faultstate *fs, vm_offset_t vaddr, int ahead) } } if (first_object != object) - VM_OBJECT_RUNLOCK(first_object); + VM_OBJECT_WUNLOCK(first_object); } /* |