]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
nfscl: Check for mmap(2)'d file before doing direct output
authorRick Macklem <rmacklem@FreeBSD.org>
Mon, 20 Dec 2021 21:08:51 +0000 (13:08 -0800)
committerRick Macklem <rmacklem@FreeBSD.org>
Mon, 20 Dec 2021 21:10:26 +0000 (13:10 -0800)
commitb70042adfebbc4ee90d6a88dd6dc34d3f8ed5c37
tree49229e47ac724af39066b0c5aada650cefd787a5
parentd69b9cc26d1c24a4cbc37478a571b1f531aa7bcc
nfscl: Check for mmap(2)'d file before doing direct output

Commit 867c27c23a5c modified the NFS client so that
it does IO_APPEND writes directly to the NFS server,
bypassing the buffer cache.  However, this could result
in stale data in client pages when the file is mmap(2)'d.
As such, the NFS client needs to call vm_object_is_active()
to check if the file is mmap(2)'d and only do direct
output if the file is not mmap(2)'d.

This patch adds this check.

Although a simple patch, I have given it a long MFC,
since the related commit 867c27c23a5c made a significant
semantics change and, as such, has a long MFC.

MFC after: 3 months
sys/fs/nfsclient/nfs_clbio.c