From patchwork Sat Feb 18 00:52:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trond Myklebust X-Patchwork-Id: 9580919 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5317E6043A for ; Sat, 18 Feb 2017 00:52:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 425B728785 for ; Sat, 18 Feb 2017 00:52:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 37378287A0; Sat, 18 Feb 2017 00:52:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EA77028785 for ; Sat, 18 Feb 2017 00:52:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752334AbdBRAwm (ORCPT ); Fri, 17 Feb 2017 19:52:42 -0500 Received: from mail-it0-f67.google.com ([209.85.214.67]:33310 "EHLO mail-it0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752302AbdBRAwl (ORCPT ); Fri, 17 Feb 2017 19:52:41 -0500 Received: by mail-it0-f67.google.com with SMTP id e137so5157170itc.0 for ; Fri, 17 Feb 2017 16:52:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=22I2PYtMOsA2Um7H45ZE48RpuIhSc6M+BF9XYocrVvc=; b=BqFV5DHXCl3MAryaeKFQ0t6BAd+MBDX2S+6tf1v0a+P6LyoSqDgNzZI1/r/FKo4Uh3 zeSgaXzHHVNFwOTa4Nb8Kx5faPjdpn/tBp3+bBzcfBbB8Lbgi3n17lr1AQS5w2ILxyEo J78b+UMlmX3TAL15PBNk6gkx+VQuXur9ZWAeKpZtv8s8VvFDU2jXAXdB6BDyatxlQz9J X11BluXcQrW8F/XQJCG1Fx8hJjw1SXf5KKqxNZ84juCb7pF0aUMGeSU30I93j5SrBLSm WVyE9UfVKanZEFOXJ+nUT5KfiRmqq08WRjOMsywppX6nOPwL9tJFGg9yvtqbUfdLuW7f ijrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=22I2PYtMOsA2Um7H45ZE48RpuIhSc6M+BF9XYocrVvc=; b=duLflQyhNjqWl6iLU/9on1Y8wAEcLpWmw9oICbvCFkpd4lUc2Ln9vwnsxM2MSs7HoD gT21tsn/uiDSBG5BT5dPJDqMhZ/PGn487VCsGiQjeflP8Q4+eQ394CbTM11XrA/S38cT 0ro2vEdz9/0+5TLPrTiJGLuU6oJH3eBEMzIfiXvY6oD8z8+8hIgfMIEOq403/syE8rhJ EEL79grTR0WkV7W9DRC8d3uG2KjPONj9f5CpC7HHqn9oMBDs6OSuHnPIxJbgj79z/wRm PhdSfTOU54ezpPbi7cnX0FaP/0eG7kn/ND2pX+uE/KwO+uJNW9Hj13EmukMgYc2oNLBh FDxQ== X-Gm-Message-State: AMke39nJz9jzsryG8Xni7AsVaxAwIUXJlUqUzYAvMIqz5bsqyVbU5J1O7YcPg6COlFATiA== X-Received: by 10.36.181.13 with SMTP id v13mr7710638ite.52.1487379160039; Fri, 17 Feb 2017 16:52:40 -0800 (PST) Received: from localhost.localdomain ([50.124.63.84]) by smtp.gmail.com with ESMTPSA id 35sm5466288iot.6.2017.02.17.16.52.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Feb 2017 16:52:39 -0800 (PST) From: Trond Myklebust To: Anna Schumaker Cc: linux-nfs@vger.kernel.org Subject: [PATCH 3/4] NFSv4: Fix the underestimation of delegation XDR space reservation Date: Fri, 17 Feb 2017 19:52:34 -0500 Message-Id: <20170218005235.65198-3-trond.myklebust@primarydata.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170218005235.65198-2-trond.myklebust@primarydata.com> References: <20170218005235.65198-1-trond.myklebust@primarydata.com> <20170218005235.65198-2-trond.myklebust@primarydata.com> Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Account for the "space_limit" field in struct open_write_delegation4. Fixes: 2cebf82883f4 ("NFSv4: Fix the underestimate of NFSv4 open request size") Signed-off-by: Trond Myklebust --- fs/nfs/nfs4xdr.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c index 62ff0ff19880..7510a0cd93fa 100644 --- a/fs/nfs/nfs4xdr.c +++ b/fs/nfs/nfs4xdr.c @@ -169,8 +169,10 @@ static int nfs4_stat_to_errno(int); open_owner_id_maxsz + \ encode_opentype_maxsz + \ encode_claim_null_maxsz) +#define decode_space_limit_maxsz (3) #define decode_ace_maxsz (3 + nfs4_owner_maxsz) #define decode_delegation_maxsz (1 + decode_stateid_maxsz + 1 + \ + decode_space_limit_maxsz + \ decode_ace_maxsz) #define decode_change_info_maxsz (5) #define decode_open_maxsz (op_decode_hdr_maxsz + \