Skip to contentSkip to conversation

NFSv4 always compare stateids in nfs4_stateid_is_current

PATCH New [email protected] 1 participant 1 message Feb 27, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 NFSv4 always compare stateids in nfs4_stateid_is_current

From: Andy Adamson <[email protected]>

When nfs4_stateid_is_current does not compare the from the wire stateid to the current stateid, nfs4_read/write_stateid_changed can return a false positive resulting in a READ or WRITE looping forever retrying a bad stateid and never triggering a stateid recovery.

Do not check the non-boolean return from nfs4_set_rw_stateid.

---
 fs/nfs/nfs4proc.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
fs/nfs/nfs4proc.c +2 -3
index 8672323..11566a4 100644
@@ -4051,10 +4051,9 @@ static bool nfs4_stateid_is_current(nfs4_stateid *stateid,
 		const struct nfs_lock_context *l_ctx,
 		fmode_t fmode)
 {
-	nfs4_stateid current_stateid;
+	nfs4_stateid current_stateid = &zero_stateid;
 
-	if (nfs4_set_rw_stateid(&current_stateid, ctx, l_ctx, fmode))
-		return false;
+	nfs4_set_rw_stateid(&current_stateid, ctx, l_ctx, fmode);
 	return nfs4_stateid_match(stateid, &current_stateid);
 }
 
Signature · 1 line
1.8.3.1