From patchwork Tue Dec 9 17:37:10 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "J. Bruce Fields" X-Patchwork-Id: 5464311 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 946E4BEEA8 for ; Tue, 9 Dec 2014 17:37:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D001720131 for ; Tue, 9 Dec 2014 17:37:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DBA7A20125 for ; Tue, 9 Dec 2014 17:37:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751352AbaLIRhM (ORCPT ); Tue, 9 Dec 2014 12:37:12 -0500 Received: from fieldses.org ([174.143.236.118]:46409 "EHLO fieldses.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750931AbaLIRhL (ORCPT ); Tue, 9 Dec 2014 12:37:11 -0500 Received: from bfields by fieldses.org with local (Exim 4.76) (envelope-from ) id 1XyOil-0000oq-1g; Tue, 09 Dec 2014 12:37:11 -0500 Date: Tue, 9 Dec 2014 12:37:10 -0500 To: Benjamin Coddington Cc: linux-nfs@vger.kernel.org Subject: Re: [PATCH 2/2] nfsd4: fix xdr4 count of server in fs_location4 Message-ID: <20141209173710.GM20526@fieldses.org> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) From: "J. Bruce Fields" Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Sun, Dec 07, 2014 at 04:05:48PM -0500, Benjamin Coddington wrote: > Fix a bug where nfsd4_encode_components_esc() incorrectly calculates the > length of server array in fs_location4. Thanks, applying as follows. This is something I don't test regularly but should. --b. commit 3e376626896b Author: Benjamin Coddington Date: Sun Dec 7 16:05:48 2014 -0500 nfsd4: fix xdr4 count of server in fs_location4 Fix a bug where nfsd4_encode_components_esc() incorrectly calculates the length of server array in fs_location4--note that it is a count of the number of array elements, not a length in bytes. Signed-off-by: Benjamin Coddington Fixes: 082d4bd72a45 (nfsd4: "backfill" using write_bytes_to_xdr_buf) Cc: stable@vger.kernel.org Signed-off-by: J. Bruce Fields --- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c index a8549f8fef57..e578c87d5527 100644 --- a/fs/nfsd/nfs4xdr.c +++ b/fs/nfsd/nfs4xdr.c @@ -1817,7 +1817,7 @@ static __be32 nfsd4_encode_components_esc(struct xdr_stream *xdr, char sep, str = end; } - pathlen = htonl(xdr->buf->len - pathlen_offset); + pathlen = htonl(count); write_bytes_to_xdr_buf(xdr->buf, pathlen_offset, &pathlen, 4); return 0; }