]> CyberLeo.Net >> Repos - FreeBSD/stable/8.git/commit
Make it possible to call VOP_PUTPAGES with shared vnode lock instead
authordelphij <delphij@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Wed, 19 Mar 2014 19:33:55 +0000 (19:33 +0000)
committerdelphij <delphij@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Wed, 19 Mar 2014 19:33:55 +0000 (19:33 +0000)
commit7dc1834ae9785e0e7bb9760c0232547463f2f2be
treeb10036380c7b0e5ff38030943e4c28ce8371ec03
parent09f0d4c48889ca759f27938ad4191ecb29bd7e12
Make it possible to call  VOP_PUTPAGES with shared vnode lock instead
of insisting an exclusive lock.

When VFS_LOCK_DEBUG is enabled and when the underlying file system is
capable of MNT_SHARED_WRITES,  a failed assertion may lead to a panic
because when calling fsync(2),  a.k.a.  sys_fsync() over a vnode with
mmap'ed page,  it will grab a shared lock when underlying file system
is capable,  then call vm_object_page_clean that eventually proceeded
to  vnode_pager_putpages()   that  tries  to do  VOP_PUTPAGES,  where
VOP_PUTPAGES_APV  generated from the declaration asserts the vnode is
always exclusively locked by caller.

This is a direct commit to stable/8 because a majority portion of the
original changeset 257899 (kib), which main goal was an optimization,
was omitted.   We saw the panic independently in a FreeNAS bug ticket
(#4578).

git-svn-id: svn://svn.freebsd.org/base/stable/8@263376 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
sys/kern/vnode_if.src