aboutsummaryrefslogtreecommitdiff
path: root/sys/fs
diff options
context:
space:
mode:
authorRick Macklem <rmacklem@FreeBSD.org>2014-12-28 21:13:52 +0000
committerRick Macklem <rmacklem@FreeBSD.org>2014-12-28 21:13:52 +0000
commit07d491dedeb2add92cd243d0995bd59520577a45 (patch)
treed9d8d4fb942c847540fcfb8b49a4b68b3b0cf6cb /sys/fs
parentefabc957c5e7cc784210e4960a8e77c97a91904d (diff)
downloadsrc-07d491dedeb2add92cd243d0995bd59520577a45.tar.gz
src-07d491dedeb2add92cd243d0995bd59520577a45.zip
r245508 modified the NFS client's Setattr RPC to
use VA_UTIMES_NULL to indicate whether it should set the time to the current tod on the server. This had the side effect of making the NFS client use the client's timestamp for exclusive create, starting with FreeBSD9.2. Unfortunately a bug in some Solaris NFS servers causes these servers to return NFS_OK to the Setattr RPC done during exclusive create, but not actually set the file's mode, leaving the file's mode == 0. This patch restores the NFS client's behaviour to use the server's tod for the exclusive open's Setattr RPC, to avoid the Solaris server bug and to restore the pre-FreeBSD9.2 NFS behaviour. Discussed on: freebsd-fs PR: 186293 MFC after: 3 months
Notes
Notes: svn path=/head/; revision=276347
Diffstat (limited to 'sys/fs')
-rw-r--r--sys/fs/nfsclient/nfs_clport.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/fs/nfsclient/nfs_clport.c b/sys/fs/nfsclient/nfs_clport.c
index efdc812610da..d3bac30bdc74 100644
--- a/sys/fs/nfsclient/nfs_clport.c
+++ b/sys/fs/nfsclient/nfs_clport.c
@@ -1096,9 +1096,16 @@ nfscl_checksattr(struct vattr *vap, struct nfsvattr *nvap)
* us to do a SETATTR RPC. FreeBSD servers store the verifier
* in atime, but we can't really assume that all servers will
* so we ensure that our SETATTR sets both atime and mtime.
+ * Set the VA_UTIMES_NULL flag for this case, so that
+ * the server's time will be used. This is needed to
+ * work around a bug in some Solaris servers, where
+ * setting the time TOCLIENT causes the Setattr RPC
+ * to return NFS_OK, but not set va_mode.
*/
- if (vap->va_mtime.tv_sec == VNOVAL)
+ if (vap->va_mtime.tv_sec == VNOVAL) {
vfs_timestamp(&vap->va_mtime);
+ vap->va_vaflags |= VA_UTIMES_NULL;
+ }
if (vap->va_atime.tv_sec == VNOVAL)
vap->va_atime = vap->va_mtime;
return (1);