freebsd-dev/sys/vm
Konstantin Belousov 555b7bb4c8 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 Provide introductory description of the default pager. 2016-12-14 23:36:32 +00:00
device_pager.c All these files need sys/vmmeter.h, but now they got it implicitly 2017-04-17 17:07:00 +00:00
memguard.c All these files need sys/vmmeter.h, but now they got it implicitly 2017-04-17 17:07:00 +00:00
memguard.h
phys_pager.c Implement the populate() pager method for phys pager. 2016-12-08 11:35:53 +00:00
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 All these files need sys/vmmeter.h, but now they got it implicitly 2017-04-17 17:07:00 +00:00
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 Fix memguard(9) in kernels with INVARIANTS enabled. 2016-06-01 22:31:35 +00:00
uma_dbg.h Move uma_dbg_alloc() and uma_dbg_free() into uma_core.c, which allows 2016-02-03 22:02:36 +00:00
uma_int.h uma: eliminate uk_slabsize field 2017-03-11 16:35:36 +00:00
uma.h Update a comment to reflect reality. 2017-03-13 18:45:25 +00:00
vm_domain.c Remove cpu_spinwait after seq_consistent. 2016-12-30 06:26:17 +00:00
vm_domain.h Add an initial NUMA affinity/policy configuration for threads and processes. 2015-07-11 15:21:37 +00:00
vm_extern.h Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
vm_fault.c Address a compilation warning on some architectures that was introduced 2017-07-23 19:35:14 +00:00
vm_glue.c Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
vm_init.c Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
vm_kern.c Use atop() instead of OFF_TO_IDX() for convertion of addresses or 2017-03-14 19:39:17 +00:00
vm_kern.h Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
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 Emulate pre-r317061 ABI. 2017-05-02 18:40:41 +00:00
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 Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
vm_pager.c Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
vm_pager.h Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
vm_param.h Commit the 64-bit inode project. 2017-05-23 09:29:05 +00:00
vm_phys.c Ifdef out the unused vm_rr_selectdomain(). 2017-02-02 17:44:55 +00:00
vm_phys.h Remove support for idle page zeroing. 2016-09-03 20:38:13 +00:00
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 Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
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