diff options
author | kib <kib@FreeBSD.org> | 2010-05-03 20:31:13 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2010-05-03 20:31:13 +0000 |
commit | 44c384aeff9f351d68878b89edebf255a4d96fe8 (patch) | |
tree | 41e82776e29be9a0454c9f015858821f979ee83e /sys/nfsclient | |
parent | 6ca323ef63a448a489c16f9cbb57db639aa48201 (diff) | |
download | FreeBSD-src-44c384aeff9f351d68878b89edebf255a4d96fe8.zip FreeBSD-src-44c384aeff9f351d68878b89edebf255a4d96fe8.tar.gz |
Lock the page around vm_page_activate() and vm_page_deactivate() calls
where it was missed. The wrapped fragments now protect wire_count with
page lock.
Reviewed by: alc
Diffstat (limited to 'sys/nfsclient')
-rw-r--r-- | sys/nfsclient/nfs_bio.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/nfsclient/nfs_bio.c b/sys/nfsclient/nfs_bio.c index cec0220..3a0705e 100644 --- a/sys/nfsclient/nfs_bio.c +++ b/sys/nfsclient/nfs_bio.c @@ -189,12 +189,14 @@ nfs_getpages(struct vop_getpages_args *ap) size = count - uio.uio_resid; VM_OBJECT_LOCK(object); - vm_page_lock_queues(); for (i = 0, toff = 0; i < npages; i++, toff = nextoff) { vm_page_t m; nextoff = toff + PAGE_SIZE; m = pages[i]; + vm_page_lock(m); + vm_page_lock_queues(); + if (nextoff <= size) { /* * Read operation filled an entire page @@ -241,8 +243,10 @@ nfs_getpages(struct vop_getpages_args *ap) vm_page_free(m); } } + + vm_page_unlock_queues(); + vm_page_unlock(m); } - vm_page_unlock_queues(); VM_OBJECT_UNLOCK(object); return (0); } |