From patchwork Sat Mar 28 15:48:21 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kinglong Mee X-Patchwork-Id: 6114181 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 78EEA9F1BE for ; Sat, 28 Mar 2015 15:48:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A351F2038E for ; Sat, 28 Mar 2015 15:48:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 994BB20386 for ; Sat, 28 Mar 2015 15:48:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752191AbbC1Psb (ORCPT ); Sat, 28 Mar 2015 11:48:31 -0400 Received: from mail-pa0-f47.google.com ([209.85.220.47]:36725 "EHLO mail-pa0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750881AbbC1Psa (ORCPT ); Sat, 28 Mar 2015 11:48:30 -0400 Received: by padcy3 with SMTP id cy3so124132532pad.3 for ; Sat, 28 Mar 2015 08:48:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=wrkfKBk7jpa6J3lA8czDwyg7IcV6GbVtT/DtHglZhnE=; b=Ke5QD5qnPlBF0w1L6U30y9Nge7QA+pN2xbnr8hhdP9X6eBerd6lCfDOjVSx+0j8L5w t4a8Lmv5iNoc5d59hrP6GN6l+uhVTcWoE+hBoviwFMKqsKbcnZJ8t1cY6FruTNGvboLa GQtfDcdfWywFec/sidIW9rSMxxJe/UxJdlzjTY9DcJXY7GPhsKJcIV7hODHK9NnYGV+9 YXsxfJJTV8sm3MmH1JLc0TybtPlvzct5qeukCsIMifwwYMXzzY9Ve1bXRnaxZ8fm3QI5 CDcE+dJ0HRb5lq2fw+ULrNv1KxMZQ7ilD5MabSxIbPA/0QHBn1A4cYU1WBkzh/TEWiW+ 62zA== X-Received: by 10.68.237.226 with SMTP id vf2mr44955011pbc.12.1427557709994; Sat, 28 Mar 2015 08:48:29 -0700 (PDT) Received: from [192.168.99.4] ([104.143.41.79]) by mx.google.com with ESMTPSA id b12sm5404970pdl.62.2015.03.28.08.48.25 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 28 Mar 2015 08:48:28 -0700 (PDT) Message-ID: <5516CD45.7060200@gmail.com> Date: Sat, 28 Mar 2015 23:48:21 +0800 From: Kinglong Mee User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: "J. Bruce Fields" , Trond Myklebust CC: Linux NFS Mailing List , Kinglong Mee Subject: [PATCH 1/4] nfs: define NFS4_MAXTAGLEN to OPAQUE limits References: <5516CCDB.4020509@gmail.com> In-Reply-To: <5516CCDB.4020509@gmail.com> 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.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, 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 According to rfc3530 and rfc5661, the max tag length should be limited by opaque limited. Signed-off-by: Kinglong Mee --- fs/nfs/nfs4xdr.c | 7 ------- include/linux/nfs4.h | 1 + 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c index 5c399ec..1c2ad01 100644 --- a/fs/nfs/nfs4xdr.c +++ b/fs/nfs/nfs4xdr.c @@ -67,13 +67,6 @@ static int nfs4_stat_to_errno(int); -/* NFSv4 COMPOUND tags are only wanted for debugging purposes */ -#ifdef DEBUG -#define NFS4_MAXTAGLEN 20 -#else -#define NFS4_MAXTAGLEN 0 -#endif - /* lock,open owner id: * we currently use size 2 (u64) out of (NFS4_OPAQUE_LIMIT >> 2) */ diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h index ed43cb7..ba54ec2 100644 --- a/include/linux/nfs4.h +++ b/include/linux/nfs4.h @@ -33,6 +33,7 @@ struct nfs4_acl { }; #define NFS4_MAXLABELLEN 2048 +#define NFS4_MAXTAGLEN NFS4_OPAQUE_LIMIT struct nfs4_label { uint32_t lfs;