summaryrefslogtreecommitdiffstats
path: root/sys/fs/tmpfs/tmpfs_subr.c
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2012-01-14 23:04:27 +0000
committeralc <alc@FreeBSD.org>2012-01-14 23:04:27 +0000
commit413b89a7e9cb148ffb08855ef27c973cfbeeb5c0 (patch)
treeb4b7b9f68b84a7f86b3d64ae99d131efcdb106e7 /sys/fs/tmpfs/tmpfs_subr.c
parent1ea7d0d666a38d5bda1efae01c48a1f3142a416c (diff)
downloadFreeBSD-src-413b89a7e9cb148ffb08855ef27c973cfbeeb5c0.zip
FreeBSD-src-413b89a7e9cb148ffb08855ef27c973cfbeeb5c0.tar.gz
Neither tmpfs_nocacheread() nor tmpfs_mappedwrite() needs to call
vm_object_pip_{add,subtract}() on the swap object because the swap object can't be destroyed while the vnode is exclusively locked. Moreover, even if the swap object could have been destroyed during tmpfs_nocacheread() and tmpfs_mappedwrite() this code is broken because vm_object_pip_subtract() does not wake up the sleeping thread that is trying to destroy the swap object. Free invalid pages after an I/O error. There is no virtue in keeping them around in the swap object creating more work for the page daemon. (I believe that any non-busy page in the swap object will now always be valid.) vm_pager_get_pages() does not return a standard errno, so its return value should not be returned by tmpfs without translation to an errno value. There is no reason for the wakeup on vpg in tmpfs_mappedwrite() to occur with the swap object locked. Eliminate printf()s from tmpfs_nocacheread() and tmpfs_mappedwrite(). (The swap pager already spam your console if data corruption is imminent.) Reviewed by: kib MFC after: 3 weeks
Diffstat (limited to 'sys/fs/tmpfs/tmpfs_subr.c')
-rw-r--r--sys/fs/tmpfs/tmpfs_subr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/fs/tmpfs/tmpfs_subr.c b/sys/fs/tmpfs/tmpfs_subr.c
index e733f19..94bc0bf 100644
--- a/sys/fs/tmpfs/tmpfs_subr.c
+++ b/sys/fs/tmpfs/tmpfs_subr.c
@@ -929,6 +929,7 @@ retry:
vm_page_sleep(m, "tmfssz");
goto retry;
}
+ MPASS(m->valid == VM_PAGE_BITS_ALL);
} else if (vm_pager_has_page(uobj, idx, NULL, NULL)) {
m = vm_page_alloc(uobj, idx, VM_ALLOC_NORMAL);
if (m == NULL) {
@@ -957,7 +958,6 @@ retry:
}
if (m != NULL) {
pmap_zero_page_area(m, base, PAGE_SIZE - base);
- MPASS(m->valid == VM_PAGE_BITS_ALL);
vm_page_dirty(m);
vm_pager_page_unswapped(m);
}
OpenPOWER on IntegriCloud