summaryrefslogtreecommitdiffstats
path: root/sys/fs
diff options
context:
space:
mode:
authorattilio <attilio@FreeBSD.org>2013-08-05 08:55:35 +0000
committerattilio <attilio@FreeBSD.org>2013-08-05 08:55:35 +0000
commit899ab645146d3b9d10334951eb65770773ed3630 (patch)
tree668bc05fd597966d485deb8ea05c427ee434fde6 /sys/fs
parent05101f7501be1dd160855b1f31fcbe7c123817ec (diff)
downloadFreeBSD-src-899ab645146d3b9d10334951eb65770773ed3630.zip
FreeBSD-src-899ab645146d3b9d10334951eb65770773ed3630.tar.gz
Revert r253939:
We cannot busy a page before doing pagefaults. Infact, it can deadlock against vnode lock, as it tries to vget(). Other functions, right now, have an opposite lock ordering, like vm_object_sync(), which acquires the vnode lock first and then sleeps on the busy mechanism. Before this patch is reinserted we need to break this ordering. Sponsored by: EMC / Isilon storage division Reported by: kib
Diffstat (limited to 'sys/fs')
-rw-r--r--sys/fs/tmpfs/tmpfs_vnops.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/sys/fs/tmpfs/tmpfs_vnops.c b/sys/fs/tmpfs/tmpfs_vnops.c
index 540eb7b..d867612 100644
--- a/sys/fs/tmpfs/tmpfs_vnops.c
+++ b/sys/fs/tmpfs/tmpfs_vnops.c
@@ -485,13 +485,13 @@ tmpfs_nocacheread(vm_object_t tobj, vm_pindex_t idx,
vm_page_zero_invalid(m, TRUE);
vm_page_wakeup(m);
}
- vm_page_io_start(m);
+ vm_page_lock(m);
+ vm_page_hold(m);
+ vm_page_unlock(m);
VM_OBJECT_WUNLOCK(tobj);
error = uiomove_fromphys(&m, offset, tlen, uio);
- VM_OBJECT_WLOCK(tobj);
- vm_page_io_finish(m);
- VM_OBJECT_WUNLOCK(tobj);
vm_page_lock(m);
+ vm_page_unhold(m);
if (m->queue == PQ_NONE) {
vm_page_deactivate(m);
} else {
@@ -602,14 +602,16 @@ tmpfs_mappedwrite(vm_object_t tobj, size_t len, struct uio *uio)
vm_page_zero_invalid(tpg, TRUE);
vm_page_wakeup(tpg);
}
- vm_page_io_start(tpg);
+ vm_page_lock(tpg);
+ vm_page_hold(tpg);
+ vm_page_unlock(tpg);
VM_OBJECT_WUNLOCK(tobj);
error = uiomove_fromphys(&tpg, offset, tlen, uio);
VM_OBJECT_WLOCK(tobj);
- vm_page_io_finish(tpg);
if (error == 0)
vm_page_dirty(tpg);
vm_page_lock(tpg);
+ vm_page_unhold(tpg);
if (tpg->queue == PQ_NONE) {
vm_page_deactivate(tpg);
} else {
OpenPOWER on IntegriCloud