opnsense-src/sys
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
..
amd64 Add support for pmap_enter(..., psind=1) to the amd64 pmap. In other words, 2017-07-23 06:33:58 +00:00
arm Use the MD __size_t to avoid a dependency on/include of non-MD header files. 2017-07-25 17:39:06 +00:00
arm64 Pass the last exception trap frame to kdb_trap. This allows show registers 2017-07-26 17:39:10 +00:00
boot Fix printf format warning in zfs_module.c 2017-07-20 20:27:19 +00:00
bsm Commit the 64-bit inode project. 2017-05-23 09:29:05 +00:00
cam This adds CAM pass(4) support for NVMe IO's. Applications indicate 2017-07-14 14:52:20 +00:00
cddl spa_import_rootpool should be able to handle an imported root pool 2017-07-25 13:17:06 +00:00
compat Upgrade to the latest sources generated from the CloudABI specification. 2017-07-26 06:57:15 +00:00
conf Allow -DNO_SKIP_DEPEND to override the _SKIP_DEPEND logic. 2017-07-25 16:46:12 +00:00
contrib Upgrade to the latest sources generated from the CloudABI specification. 2017-07-26 06:57:15 +00:00
crypto Remove register keyword from sys/ and ANSIfy prototypes 2017-05-17 00:34:34 +00:00
ddb Include opt files in the kernel with "" instead of <>. 2017-07-10 05:08:01 +00:00
dev [iwm] Sync rs (rate-selection) API definitions from Linux iwlwifi. 2017-07-26 05:52:37 +00:00
fs Mark pages after EOF as clean after pageout. 2017-07-26 20:07:05 +00:00
gdb CALLOUT_MPSAFE has lost its meaning since r141428, i.e., for more than ten 2015-05-22 17:05:21 +00:00
geom Add GEOM::descr attribute for symmetry with GEOM::ident. 2017-07-06 08:36:14 +00:00
gnu Update DTS files from Linux 4.12 2017-07-09 13:53:32 +00:00
i386 Fix handling of one more possible exception on return to usermode. 2017-07-08 11:07:39 +00:00
isa Protect access to the AT realtime clock with its own mutex. 2017-07-12 02:42:57 +00:00
kern Change the interactions of the interface functions with the "meta" and 2017-07-24 17:23:53 +00:00
kgssapi kgssapi: insignificant spelling fix. 2016-05-03 22:05:03 +00:00
libkern arm64: add ".arch armv8-a+crc" to allow use of crc instructions 2017-06-08 20:06:09 +00:00
mips [ar933x] make carambola2 work again! 2017-07-23 07:10:41 +00:00
modules qlnx: gcc build errors 2017-07-18 06:15:05 +00:00
net Don't hold the RM lock during lagg_proto_addport() to avoid an LOR. 2017-07-25 14:41:50 +00:00
net80211 net80211: do not allow to unload rate control module if it is still in use. 2017-07-23 22:38:00 +00:00
netgraph Check return value from soaccept(). 2017-06-14 16:13:20 +00:00
netinet Revert r307901 - Inform CC modules about loss events. 2017-07-25 15:08:52 +00:00
netinet6 Use memset/memcpy instead of bzero/bcopy. 2017-07-19 14:28:58 +00:00
netipsec Build kdebug_secreplay() function only when IPSEC_DEBUG is defined. 2017-06-01 10:04:12 +00:00
netpfil Fix a couple of typos in a comment. 2017-07-21 03:04:55 +00:00
netsmb sys/net*: minor spelling fixes. 2016-05-03 18:05:43 +00:00
nfs Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
nfsclient Add an NFSv4.1 mount option for "use one openowner". 2017-04-13 21:54:19 +00:00
nfsserver Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
nlm Commit the 64-bit inode project. 2017-05-23 09:29:05 +00:00
ofed Avoid including list.h in LinuxKPI headers. 2017-06-18 16:43:57 +00:00
opencrypto Use const with some read-only buffers in opencrypto APIs. 2017-05-09 18:28:42 +00:00
powerpc Add cpufreq support for P1022 and MPC8536 2017-07-21 03:40:05 +00:00
riscv Clean up MD pollution of bus_dma.h: 2017-07-01 05:35:29 +00:00
rpc Listening sockets improvements. 2017-06-08 21:30:34 +00:00
security Correct bitwise test in mac_bsdextended ugidfw_rule_valid() 2017-06-13 01:17:58 +00:00
sparc64 Clean up MD pollution of bus_dma.h: 2017-07-01 05:35:29 +00:00
sys Mark name_PCTRIE_LOOKUP_LE() generated function unused. 2017-07-26 06:42:01 +00:00
teken Oops, my fix for bright colors broke bright black some more (in cases 2017-03-27 10:48:28 +00:00
tests style(9): sort headers 2017-05-09 05:08:47 +00:00
tools make.conf: Add the possibility to use another DTC 2017-06-17 23:34:53 +00:00
ufs Improve publication of the newly allocated snapdata. 2017-07-21 18:42:35 +00:00
vm Mark pages after EOF as clean after pageout. 2017-07-26 20:07:05 +00:00
x86 __pcpu: gcc -Wredundant-decls 2017-07-21 17:11:36 +00:00
xdr * limit size of buffers to RPC_MAXDATASIZE 2017-06-01 06:12:25 +00:00
xen xenstore: fix suspension when using the xenstore device 2017-03-07 09:17:48 +00:00
Makefile Remove glimpse make target added in r181432 2017-05-22 15:53:30 +00:00