Skip to contentSkip to conversation

nfsd4: fix off-by-one-error in SEQUENCE reply

PATCH New J. Bruce Fields 1 participant 1 message Aug 31, 2011

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

PATCH 1/1 nfsd4: fix off-by-one-error in SEQUENCE reply

From: J. Bruce Fields <[email protected]>

The values here represent highest slotid numbers. Since slotid's are numbered starting from zero, the highest should be one less than the number of slots.

---
 fs/nfsd/nfs4xdr.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

Queuing up for 3.2.

fs/nfsd/nfs4xdr.c +3 -3
index 1aa6270..fc506e0 100644
@@ -3224,9 +3224,9 @@ nfsd4_encode_sequence(struct nfsd4_compoundres *resp, int nfserr,
 	WRITEMEM(seq->sessionid.data, NFS4_MAX_SESSIONID_LEN);
 	WRITE32(seq->seqid);
 	WRITE32(seq->slotid);
-	WRITE32(seq->maxslots);
-	/* For now: target_maxslots = maxslots */
-	WRITE32(seq->maxslots);
+	/* Note slotid's are numbered from zero: */
+	WRITE32(seq->maxslots - 1); /* sr_highest_slotid */
+	WRITE32(seq->maxslots - 1); /* sr_target_highest_slotid */
 	WRITE32(seq->status_flags);
 
 	ADJUST_ARGS();
Signature · 1 line
1.7.4.1