From patchwork Sat Mar 28 15:46:09 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kinglong Mee X-Patchwork-Id: 6114161 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.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id CE69CBF4A6 for ; Sat, 28 Mar 2015 15:46:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C2E332039C for ; Sat, 28 Mar 2015 15:46:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DAC1A20386 for ; Sat, 28 Mar 2015 15:46:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751471AbbC1PqT (ORCPT ); Sat, 28 Mar 2015 11:46:19 -0400 Received: from mail-pa0-f53.google.com ([209.85.220.53]:34306 "EHLO mail-pa0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750829AbbC1PqS (ORCPT ); Sat, 28 Mar 2015 11:46:18 -0400 Received: by pacwe9 with SMTP id we9so124101928pac.1 for ; Sat, 28 Mar 2015 08:46:18 -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 :content-type:content-transfer-encoding; bh=/WaMFU+rERjguqkjZRf+XuVsyjfFuI7xQPvsrWPMQfg=; b=HuhKa3JT7t7c41MpIflFmfN3yLlq6qKKz+ANG/ZqeOY5dhki9zE8h0+O6xyQpKnfTr xjCWLr66X/9npRC/6Dic5sGl5ETtfFrAR5uYiEEl5PVDNfWUToxAq1E6JAFLxmDyQen6 eVtHPZbN20S9nriV7drdrYjGKpXfj/3cnocpfWpyNolYWUGLEQCxDaYsslG2NNYLU7ik tl9SFXuyrdXFupGvy9wRYZrCyKuED1BvnnshKx7H4IQyakoYzxsShgwTI6IlFTJQXmz/ fEXOkj5PG72FAxlmQ6DDXX9NKLmH0Dtv49I0xcHHGHMNsvjQelJWNau1xabwzRHpheYy cd2g== X-Received: by 10.68.230.34 with SMTP id sv2mr44093350pbc.157.1427557578335; Sat, 28 Mar 2015 08:46:18 -0700 (PDT) Received: from [192.168.99.4] ([104.143.41.79]) by mx.google.com with ESMTPSA id hh2sm5384642pbb.93.2015.03.28.08.46.13 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 28 Mar 2015 08:46:16 -0700 (PDT) Message-ID: <5516CCC1.2090608@gmail.com> Date: Sat, 28 Mar 2015 23:46:09 +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" CC: Linux NFS Mailing List , kinglongmee@gmail.com Subject: [PATCH] nfsd: Remove duplicate macro define for max sec label length 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 NFS4_MAXLABELLEN has defined for sec label max length, use it directly. Signed-off-by: Kinglong Mee --- fs/nfsd/nfs4proc.c | 2 +- fs/nfsd/nfs4xdr.c | 2 +- fs/nfsd/xdr4.h | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c index d30bea8..6bd4391 100644 --- a/fs/nfsd/nfs4proc.c +++ b/fs/nfsd/nfs4proc.c @@ -1815,7 +1815,7 @@ static inline u32 nfsd4_getattr_rsize(struct svc_rqst *rqstp, bmap0 &= ~FATTR4_WORD0_FILEHANDLE; } if (bmap2 & FATTR4_WORD2_SECURITY_LABEL) { - ret += NFSD4_MAX_SEC_LABEL_LEN + 12; + ret += NFS4_MAXLABELLEN + 12; bmap2 &= ~FATTR4_WORD2_SECURITY_LABEL; } /* diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c index df5e66c..eff0a94 100644 --- a/fs/nfsd/nfs4xdr.c +++ b/fs/nfsd/nfs4xdr.c @@ -424,7 +424,7 @@ nfsd4_decode_fattr(struct nfsd4_compoundargs *argp, u32 *bmval, len += 4; dummy32 = be32_to_cpup(p++); READ_BUF(dummy32); - if (dummy32 > NFSD4_MAX_SEC_LABEL_LEN) + if (dummy32 > NFS4_MAXLABELLEN) return nfserr_badlabel; len += (XDR_QUADLEN(dummy32) << 2); READMEM(buf, dummy32); diff --git a/fs/nfsd/xdr4.h b/fs/nfsd/xdr4.h index 0bda93e..8bae5d8 100644 --- a/fs/nfsd/xdr4.h +++ b/fs/nfsd/xdr4.h @@ -40,7 +40,6 @@ #include "state.h" #include "nfsd.h" -#define NFSD4_MAX_SEC_LABEL_LEN 2048 #define NFSD4_MAX_TAGLEN 128 #define XDR_LEN(n) (((n) + 3) & ~3)