freebsd-dev/sys/fs/smbfs
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
..
smbfs_io.c Mark pages after EOF as clean after pageout. 2017-07-26 20:07:05 +00:00
smbfs_node.c Replace all remaining calls to vprint(9) with vn_printf(9), and remove 2016-08-10 16:12:31 +00:00
smbfs_node.h
smbfs_smb.c Change the type of newsize argument in the smbfs_smb_setfsize() function 2016-01-11 18:11:06 +00:00
smbfs_subr.c Cleanup unnecessary semicolons from the kernel. 2016-04-10 23:07:00 +00:00
smbfs_subr.h sys/fs: spelling fixes in comments. 2016-04-29 20:51:24 +00:00
smbfs_vfsops.c
smbfs_vnops.c Consistently use vop_stdpathconf() for default pathconf values. 2017-07-11 21:55:20 +00:00
smbfs.h