From patchwork Sun Feb 19 21:08:29 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trond Myklebust X-Patchwork-Id: 9581831 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 5E7F56045A for ; Sun, 19 Feb 2017 21:08:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4F50128708 for ; Sun, 19 Feb 2017 21:08:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 446472870F; Sun, 19 Feb 2017 21:08:46 +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 E37E628708 for ; Sun, 19 Feb 2017 21:08:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751790AbdBSVIp (ORCPT ); Sun, 19 Feb 2017 16:08:45 -0500 Received: from mail-it0-f65.google.com ([209.85.214.65]:34548 "EHLO mail-it0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751669AbdBSVIo (ORCPT ); Sun, 19 Feb 2017 16:08:44 -0500 Received: by mail-it0-f65.google.com with SMTP id r141so8890448ita.1 for ; Sun, 19 Feb 2017 13:08:43 -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=DBDpM3hpAMYy0qGzTNfDgKrul7N89RHbZFJy+Y99dyE=; b=qhwicdS1u8b+bN/iO+iKnjRuhJwz5fm4N6ZEqG2yGYzJQcUs/quXQBoZEXS6BcEFU9 bYAcNSmi962tuyv09c6Ffml1kVKFD6MYFY1UKTtTbrU9Ufr7nf4SUHu5kPBiivS0lTMp QkRvYvQA0vKewPvyRi/NuOq/km+GDYuTdGyP48R0RakSUbQmhQSkJwGfQIf5EoSeWhfN fhL92V3RiDsQFb2ZgZyDMduIyCOANtaobEku41c49lMy97x26+zG5HS99+qc5HbCcXLf AHa8U/FBSgx01U0hEj/hFaijEdZBHCAegfMe3YRRypnnjHDWwO9KBypN6ICum7zNCrzI 5nvQ== 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=DBDpM3hpAMYy0qGzTNfDgKrul7N89RHbZFJy+Y99dyE=; b=Cwr2h8ssTA31419axjugMxS8sjVRbXuj8Gg4ZQdmUVKsh7zZt2YEAqARhBvy+k8Weo G2oXx5F0tzAfJDkaUVB0XsjUgiTtbhQIxAA4Hc4fQ3nt10QqCufC4gVk+/gB5vbrqVvZ b5jh/xiqEvH8Qjq2SWVbR7tSpj+xJdBslxUgcj+G8YbjQ3L5ysduRzhxMuf8KAe9NBFG 07Dp1KNtrgTn7Llg/p+AQIDO0Kz/gwxF3YfNGSkhCVaELzzu8kr8z2yyK6c4i1+XztMR XCbqoE6NhYxxe0Vf5tbGy+s48xvY1ES5bMH544jXQZwti6sZjXZgPLhPffZztxNsu05C veUg== X-Gm-Message-State: AMke39nTCEwaealvmhDvOyxrS9aUfB927PCNT+bNdSiRmLj0UaDmxu6/nGC9zgHWGgVHdg== X-Received: by 10.36.65.4 with SMTP id x4mr18054266ita.69.1487538523401; Sun, 19 Feb 2017 13:08:43 -0800 (PST) Received: from localhost.localdomain ([50.124.63.84]) by smtp.gmail.com with ESMTPSA id g204sm4076485ita.31.2017.02.19.13.08.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 19 Feb 2017 13:08:42 -0800 (PST) From: Trond Myklebust To: Anna Schumaker , Chuck Lever Cc: linux-nfs@vger.kernel.org Subject: [PATCH v5 5/8] NFSv4: Fix the underestimation of delegation XDR space reservation Date: Sun, 19 Feb 2017 16:08:29 -0500 Message-Id: <20170219210832.61213-6-trond.myklebust@primarydata.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170219210832.61213-5-trond.myklebust@primarydata.com> References: <20170219210832.61213-1-trond.myklebust@primarydata.com> <20170219210832.61213-2-trond.myklebust@primarydata.com> <20170219210832.61213-3-trond.myklebust@primarydata.com> <20170219210832.61213-4-trond.myklebust@primarydata.com> <20170219210832.61213-5-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 Reviewed-by: Chuck Lever --- fs/nfs/nfs4xdr.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c index d10cc2a62dff..26808fbaacb0 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 + \