Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 27 Apr 2019 23:29:56 +0000 (UTC)
From:      Rick Macklem <rmacklem@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r346798 - projects/nfsv42/sys/fs/nfs
Message-ID:  <201904272329.x3RNTu8M073407@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rmacklem
Date: Sat Apr 27 23:29:55 2019
New Revision: 346798
URL: https://svnweb.freebsd.org/changeset/base/346798

Log:
  Add code that will clear the NFSv4.2 attributes for non-NFSv4.2 mounts.

Modified:
  projects/nfsv42/sys/fs/nfs/nfs.h
  projects/nfsv42/sys/fs/nfs/nfsproto.h

Modified: projects/nfsv42/sys/fs/nfs/nfs.h
==============================================================================
--- projects/nfsv42/sys/fs/nfs/nfs.h	Sat Apr 27 22:31:41 2019	(r346797)
+++ projects/nfsv42/sys/fs/nfs/nfs.h	Sat Apr 27 23:29:55 2019	(r346798)
@@ -431,6 +431,8 @@ typedef struct {
 		(b)->bits[1] &= ~NFSATTRBIT_NFSV41_1;			\
 		(b)->bits[2] &= ~NFSATTRBIT_NFSV41_2;			\
 	}								\
+	if (((n)->nd_flag & ND_NFSV42) == 0)				\
+		(b)->bits[2] &= ~NFSATTRBIT_NFSV42_2;			\
 } while (0)
 
 #define	NFSISSET_ATTRBIT(b, p)	((b)->bits[(p) / 32] & (1 << ((p) % 32)))
@@ -457,6 +459,8 @@ typedef struct {
 		(b)->bits[1] &= ~NFSATTRBIT_NFSV41_1;			\
 		(b)->bits[2] &= ~NFSATTRBIT_NFSV41_2;			\
 	}								\
+	if (((n)->nd_flag & ND_NFSV42) == 0)				\
+		(b)->bits[2] &= ~NFSATTRBIT_NFSV42_2;			\
 } while (0)
 
 #define	NFSCLRNOTSETABLE_ATTRBIT(b, n) do { 				\
@@ -465,6 +469,8 @@ typedef struct {
 	(b)->bits[2] &= NFSATTRBIT_SETABLE2;				\
 	if (((n)->nd_flag & ND_NFSV41) == 0)				\
 		(b)->bits[2] &= ~NFSATTRBIT_NFSV41_2;			\
+	if (((n)->nd_flag & ND_NFSV42) == 0)				\
+		(b)->bits[2] &= ~NFSATTRBIT_NFSV42_2;			\
 } while (0)
 
 #define	NFSNONZERO_ATTRBIT(b)	((b)->bits[0] || (b)->bits[1] || (b)->bits[2])

Modified: projects/nfsv42/sys/fs/nfs/nfsproto.h
==============================================================================
--- projects/nfsv42/sys/fs/nfs/nfsproto.h	Sat Apr 27 22:31:41 2019	(r346797)
+++ projects/nfsv42/sys/fs/nfs/nfsproto.h	Sat Apr 27 23:29:55 2019	(r346798)
@@ -1159,6 +1159,11 @@ struct nfsv3_sattr {
 	NFSATTRBM_SUPPATTREXCLCREAT)
 
 /*
+ * NFSATTRBIT_NFSV42 - Attributes only supported by NFSv4.2.
+ */
+#define	NFSATTRBIT_NFSV42_2	0
+
+/*
  * Set of attributes that the getattr vnode op needs.
  * OR of the following bits.
  * NFSATTRBIT_GETATTR0 - bits 0<->31



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