freebsd-skq/sys/vm
kib 8fd2052d87 Mark pages after EOF as clean after pageout.
Suppose that a file on NFS has partially filled last page, and this
page is dirty.  NFS VOP_PAGEOUT() method only marks the the page clean
up to the block of the last written byte, leaving other blocks dirty.
Also any page which erronously exists in the vnode vm_object past EOF
is also left marked as dirty.

With the introduction of the buf-cache coherent pager, each pass of
syncer over the object with such page results in creation of B_DELWRI
buffer due to VOP_WRITE() call.  This buffer is noted on next syncer
pass, which results e.g. a visible manifestation of shutdown never
finishing vnode sync.  Note that before buf-cache coherency commit, a
dirty page might left never synced to server if a partial writes
occur.

Fix this by clearing dirty bits after EOF.  Only blocks of the partial
page which are completely after EOF are marked clean, to avoid
possible user data loss.

Reported by:	mav
Reviewed by:	alc, markj
Tested by:	mav, pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D11697
2017-07-26 20:07:05 +00:00
..
_vm_radix.h Add pctrie_init() and vm_radix_init() to initialize generic pctrie and 2017-07-19 20:52:47 +00:00
default_pager.c
device_pager.c
memguard.c
memguard.h
phys_pager.c
pmap.h Add support for pmap_enter(..., psind=1) to the amd64 pmap. In other words, 2017-07-23 06:33:58 +00:00
redzone.c
redzone.h
sg_pager.c
swap_pager.c Remove unused function swap_pager_isswapped(). 2017-07-19 17:28:46 +00:00
swap_pager.h Remove unused function swap_pager_isswapped(). 2017-07-19 17:28:46 +00:00
uma_core.c When we are in UMA_STARTUP use startup_alloc() for any zone, not for 2017-06-08 21:33:19 +00:00
uma_dbg.c
uma_dbg.h
uma_int.h
uma.h
vm_domain.c
vm_domain.h
vm_extern.h
vm_fault.c Address a compilation warning on some architectures that was introduced 2017-07-23 19:35:14 +00:00
vm_glue.c
vm_init.c
vm_kern.c
vm_kern.h
vm_map.c Disable stack growth when accessed by AIO daemons. 2017-07-19 19:00:32 +00:00
vm_map.h Treat the addr argument for mmap(2) request without MAP_FIXED flag as 2017-06-28 04:02:36 +00:00
vm_meter.c
vm_mmap.c Treat the addr argument for mmap(2) request without MAP_FIXED flag as 2017-06-28 04:02:36 +00:00
vm_object.c Do not allocate struct kinfo_vmobject on stack. 2017-07-22 13:33:06 +00:00
vm_object.h Fix style: change spaces to tabs. 2017-07-21 14:14:47 +00:00
vm_page.c In vm_page_ps_test(), always check that the base pages within the specified 2017-07-23 05:54:56 +00:00
vm_page.h Generalize vm_page_ps_is_valid() to support testing other predicates on 2017-07-14 02:15:48 +00:00
vm_pageout.c Increase the pageout cluster size to 32 pages. 2017-06-24 17:10:33 +00:00
vm_pageout.h
vm_pager.c
vm_pager.h
vm_param.h
vm_phys.c
vm_phys.h
vm_radix.c Add pctrie_init() and vm_radix_init() to initialize generic pctrie and 2017-07-19 20:52:47 +00:00
vm_radix.h Add pctrie_init() and vm_radix_init() to initialize generic pctrie and 2017-07-19 20:52:47 +00:00
vm_reserv.c Utilize pmap_enter(..., psind=1) in vm_fault_soft_fast() on amd64. (The 2017-07-23 16:28:13 +00:00
vm_reserv.h Utilize pmap_enter(..., psind=1) in vm_fault_soft_fast() on amd64. (The 2017-07-23 16:28:13 +00:00
vm_unix.c
vm.h Implement address space guards. 2017-06-24 17:01:11 +00:00
vnode_pager.c Mark pages after EOF as clean after pageout. 2017-07-26 20:07:05 +00:00
vnode_pager.h Mark pages after EOF as clean after pageout. 2017-07-26 20:07:05 +00:00