]> CyberLeo.Net >> Repos - FreeBSD/stable/8.git/commit
MFC: r235332
authorrmacklem <rmacklem@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Sun, 27 May 2012 14:20:46 +0000 (14:20 +0000)
committerrmacklem <rmacklem@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Sun, 27 May 2012 14:20:46 +0000 (14:20 +0000)
commiteef4527a8a335a0a92f5e3c74c25d0d42bc2af45
tree6a34e283923ea77979d662e5b3d726072e7cf792
parentbbc04c192e81119b38f93a6064c332a00be8fa50
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/8@236150 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