nfsd4: fix off-by-one-error in SEQUENCE reply
authorJ. Bruce Fields <bfields@redhat.com>
Wed, 31 Aug 2011 19:39:30 +0000 (15:39 -0400)
committerJ. Bruce Fields <bfields@redhat.com>
Wed, 31 Aug 2011 21:55:57 +0000 (17:55 -0400)
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.

Reported-by: Rick Macklem <rmacklem@uoguelph.ca>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/nfsd/nfs4xdr.c

index 04ad9a2ca3d04b08cf0f11757526163928a0c0fe..f982d8574d956d8d6367caa0e6abb6231cadcdad 100644 (file)
@@ -3221,9 +3221,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();