]> CyberLeo.Net >> Repos - FreeBSD/stable/9.git/commit
MFC: r235332
authorrmacklem <rmacklem@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Sat, 26 May 2012 13:12:14 +0000 (13:12 +0000)
committerrmacklem <rmacklem@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Sat, 26 May 2012 13:12:14 +0000 (13:12 +0000)
commit47d73d5e967390dcf6a0b8f48a2e114e36bf0447
tree62444de9a0b002ab3cdc1abe42d3c2eb224c589c
parentb6e68b4162d74744fc77ddce25d393d1f78a2312
MFC: r235332
PR# 165923 reported intermittent write failures for dirty
memory mapped pages being written back on an NFS mount.
Since any thread can call VOP_PUTPAGES() to write back a
dirty page, the credentials of that thread may not have
write access to the file on an NFS server. (Often the uid
is 0, which may be mapped to "nobody" in the NFS server.)
Although there is no completely correct fix for this
(NFS servers check access on every write RPC instead of at
open/mmap time), this patch avoids the common cases by
holding onto a credential that recently opened the file
for writing and uses that credential for the write RPCs
being done by VOP_PUTPAGES() for both NFS clients.

git-svn-id: svn://svn.freebsd.org/base/stable/9@236096 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
sys/fs/nfsclient/nfs_clbio.c
sys/fs/nfsclient/nfs_clnode.c
sys/fs/nfsclient/nfs_clvnops.c
sys/fs/nfsclient/nfsnode.h
sys/nfsclient/nfs_bio.c
sys/nfsclient/nfs_node.c
sys/nfsclient/nfs_vnops.c
sys/nfsclient/nfsnode.h