From patchwork Wed Aug 31 19:44:00 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "J. Bruce Fields" X-Patchwork-Id: 1117582 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p7VJi3GX009946 for ; Wed, 31 Aug 2011 19:44:03 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753022Ab1HaToB (ORCPT ); Wed, 31 Aug 2011 15:44:01 -0400 Received: from fieldses.org ([174.143.236.118]:58988 "EHLO fieldses.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752937Ab1HaToA (ORCPT ); Wed, 31 Aug 2011 15:44:00 -0400 Received: from bfields by fieldses.org with local (Exim 4.72) (envelope-from ) id 1Qyqhc-000561-36; Wed, 31 Aug 2011 15:44:00 -0400 Date: Wed, 31 Aug 2011 15:44:00 -0400 To: linux-nfs@vger.kernel.org Cc: Rick Macklem Subject: [PATCH] nfsd4: fix off-by-one-error in SEQUENCE reply Message-ID: <20110831194400.GC19223@fieldses.org> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) From: "J. Bruce Fields" Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Wed, 31 Aug 2011 19:44:03 +0000 (UTC) From: J. Bruce Fields 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 Signed-off-by: J. Bruce Fields --- fs/nfsd/nfs4xdr.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) Queuing up for 3.2. diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c index 1aa6270..fc506e0 100644 --- a/fs/nfsd/nfs4xdr.c +++ b/fs/nfsd/nfs4xdr.c @@ -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();