summaryrefslogtreecommitdiffstats
path: root/sys/fs/nfsclient/nfs_clnode.c
diff options
context:
space:
mode:
authorrmacklem <rmacklem@FreeBSD.org>2012-05-12 12:02:51 +0000
committerrmacklem <rmacklem@FreeBSD.org>2012-05-12 12:02:51 +0000
commit6a6a18bf5cd7caebec476234cbf2b10a703e7716 (patch)
treecec7c23a3a6eb769268eaeb44dacf6f9ac149b47 /sys/fs/nfsclient/nfs_clnode.c
parent79b0e4a50a30baea8c74aaa515a5b91047812153 (diff)
downloadFreeBSD-src-6a6a18bf5cd7caebec476234cbf2b10a703e7716.zip
FreeBSD-src-6a6a18bf5cd7caebec476234cbf2b10a703e7716.tar.gz
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. Tested by: Joel Ray Holveck (joelh at juniper.net) PR: kern/165923 Reviewed by: kib MFC after: 2 weeks
Diffstat (limited to 'sys/fs/nfsclient/nfs_clnode.c')
-rw-r--r--sys/fs/nfsclient/nfs_clnode.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/fs/nfsclient/nfs_clnode.c b/sys/fs/nfsclient/nfs_clnode.c
index 21de25e..db3a350 100644
--- a/sys/fs/nfsclient/nfs_clnode.c
+++ b/sys/fs/nfsclient/nfs_clnode.c
@@ -300,6 +300,8 @@ ncl_reclaim(struct vop_reclaim_args *ap)
FREE((caddr_t)dp2, M_NFSDIROFF);
}
}
+ if (np->n_writecred != NULL)
+ crfree(np->n_writecred);
FREE((caddr_t)np->n_fhp, M_NFSFH);
if (np->n_v4 != NULL)
FREE((caddr_t)np->n_v4, M_NFSV4NODE);
OpenPOWER on IntegriCloud