freebsd-nq/sys/ufs/ffs
Konstantin Belousov 1eabd96728 vfs_msync(), called from syncer vnode fsync VOP, only iterates over
the active vnode list for the given mount point, with the assumption
that vnodes with dirty pages are active.  This is enforced by
vinactive() doing vm_object_page_clean() pass over the vnode pages.

The issue is, if vinactive() cannot be called during vput() due to the
vnode being only shared-locked, we might end up with the dirty pages
for the vnode on the free list.  Such vnode is invisible to syncer,
and pages are only cleaned on the vnode reactivation.  In other words,
the race results in the broken guarantee that user data, written
through the mmap(2), is written to the disk not later than in 30
seconds after the write.

Fix this by keeping the vnode which is freed but still owing
inactivation, on the active list.  When syncer loops find such vnode,
it is deactivated and cleaned by the final vput() call.

Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
2015-06-17 04:46:58 +00:00
..
ffs_alloc.c Replace struct filedesc argument in getvnode with struct thread 2015-06-16 13:09:18 +00:00
ffs_balloc.c ufs: small formatting fixes. 2014-03-02 02:52:34 +00:00
ffs_extern.h ufs: small formatting fixes. 2014-03-02 02:52:34 +00:00
ffs_inode.c
ffs_rawread.c Initialize the pbuf counter for directio using SYSINIT, instead of 2014-06-08 10:55:06 +00:00
ffs_snapshot.c The VOP_LOOKUP() implementations for CREATE op do not put the name 2014-12-18 10:01:12 +00:00
ffs_softdep.c Remove unused variable. 2015-05-31 15:50:54 +00:00
ffs_subr.c
ffs_suspend.c Remove several write-only variables, all reported by the gcc 4.9 2015-05-29 13:24:17 +00:00
ffs_tables.c
ffs_vfsops.c vfs_msync(), called from syncer vnode fsync VOP, only iterates over 2015-06-17 04:46:58 +00:00
ffs_vnops.c Syncing a directory vnode might drop the vnode lock in the 2015-06-03 20:48:00 +00:00
fs.h ufs: small formatting fixes. 2014-03-02 02:52:34 +00:00
softdep.h When mounting SU-enabled mount point, wait until the softdep_flush() 2015-01-30 11:41:46 +00:00