]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Finally fix the VM bug where a file whos EOF occurs in the middle of a page
authordillon <dillon@FreeBSD.org>
Fri, 12 Oct 2001 18:17:34 +0000 (18:17 +0000)
committerdillon <dillon@FreeBSD.org>
Fri, 12 Oct 2001 18:17:34 +0000 (18:17 +0000)
commit8a2a967bbcca05b13f23d48ad418b90d3f181874
treec5b4de4e527c4fd8807da4310826f2f59cf9f41a
parent7ed22e2aa0bd38f7569dabe49b488e59c093ad12
Finally fix the VM bug where a file whos EOF occurs in the middle of a page
would sometimes prevent a dirty page from being cleaned, even when synced,
resulting in the dirty page being re-flushed to disk every 30-60 seconds or
so, forever.  The problem is that when the filesystem flushes a page to
its backing file it typically does not clear dirty bits representing areas
of the page that are beyond the file EOF.  If the file is also mmap()'d and
a fault is taken, vm_fault (properly, is required to) set the vm_page_t->dirty
bits to VM_PAGE_BITS_ALL.  This combination could leave us with an uncleanable,
unfreeable page.

The solution is to have the vnode_pager detect the edge case and manually
clear the dirty bits representing areas beyond the file EOF.  The filesystem
does the rest and the page comes up clean after the write completes.

MFC after: 3 days
sys/vm/vnode_pager.c