]> CyberLeo.Net >> Repos - FreeBSD/stable/9.git/commit
Partial MFC of r253927 (by attilio):
authorkib <kib@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Tue, 27 Aug 2013 03:11:49 +0000 (03:11 +0000)
committerkib <kib@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Tue, 27 Aug 2013 03:11:49 +0000 (03:11 +0000)
commit6eb58e8934620dbb9dbc408b7e2d265ac4ba3bc6
tree25eaa4572b75cb69fa6561755dbd95e522092f82
parentb6e2bd9ef6a98fcc8f4368f3d1c7b864bb2638a5
Partial MFC of r253927 (by attilio):
Remove unnecessary soft busy of the page before to do vn_rdwr() in
kern_sendfile() which is unnecessary.

MFC note:
NFS implementation of VOP_READ() sometimes upgrades the vnode lock,
which causes drop of the shared lock and sleep for exclusive.  As
result, busying of the page before the call to vn_rdwr() makes NFS
code to wait for vnode lock while page is busy, which contradicts the
proper order of vnode lock -> busy.

The r250027, merged as part of r250907, started calling vm_page_grab()
under the vnode lock.  The page grab waits for the page busy state to
drain, which makes the parallel sendfile(2) invocations on the same
vnode vulnerable to the LOR described above.

Note that r250027 only exposed the problem, which might be caused by
other means as well, e.g. by parallel sendfile(2) and truncate(2).

Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/9@254947 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
sys/kern/uipc_syscalls.c