changeset 13943:803d9c69618b

NFS: what_stateid_error() fix stateid boottime comparison. It's not corrent to compare id->v4_bits.boottime with instance start_time in terms of "greater" or "less". Time can be changed by system administrator and hence it's better to use "not equal", which clearly determines that state is expired.
author Dan Kruchinin <dan.kruchinin@nexenta.com>
date Fri, 02 Sep 2011 20:07:59 +0300
parents 908712a01b0b
children fe8c3c09947b
files usr/src/uts/common/fs/nfs/nfs4_state.c
diffstat 1 files changed, 5 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/uts/common/fs/nfs/nfs4_state.c	Fri Sep 02 19:10:20 2011 +0300
+++ b/usr/src/uts/common/fs/nfs/nfs4_state.c	Fri Sep 02 20:07:59 2011 +0300
@@ -2822,7 +2822,7 @@
 		return (NFS4ERR_BAD_STATEID);
 
 	/* From a previous server instantiation, return STALE */
-	if (id->v4_bits.boottime < cs->instp->start_time)
+	if (id->v4_bits.boottime != cs->instp->start_time)
 		return (NFS4ERR_STALE_STATEID);
 
 	/*
@@ -2837,14 +2837,10 @@
 	 * that has been revoked, the server should return BAD_STATEID
 	 * instead of the more common EXPIRED error.
 	 */
-	if (id->v4_bits.boottime == cs->instp->start_time) {
-		if (type == DELEGID)
-			return (NFS4ERR_BAD_STATEID);
-		else
-			return (NFS4ERR_EXPIRED);
-	}
-
-	return (NFS4ERR_BAD_STATEID);
+	if (type == DELEGID)
+		return (NFS4ERR_BAD_STATEID);
+
+	return (NFS4ERR_EXPIRED);
 }
 
 /*