Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 10 Apr 2015 23:43:02 +0000 (UTC)
From:      Rick Macklem <rmacklem@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r281386 - stable/10/sys/fs/nfsclient
Message-ID:  <201504102343.t3ANh2CO024719@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rmacklem
Date: Fri Apr 10 23:43:01 2015
New Revision: 281386
URL: https://svnweb.freebsd.org/changeset/base/281386

Log:
  MFC: r276347
  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.

Modified:
  stable/10/sys/fs/nfsclient/nfs_clport.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/fs/nfsclient/nfs_clport.c
==============================================================================
--- stable/10/sys/fs/nfsclient/nfs_clport.c	Fri Apr 10 22:53:07 2015	(r281385)
+++ stable/10/sys/fs/nfsclient/nfs_clport.c	Fri Apr 10 23:43:01 2015	(r281386)
@@ -1097,9 +1097,16 @@ nfscl_checksattr(struct vattr *vap, stru
 	 * 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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201504102343.t3ANh2CO024719>