From patchwork Sat May 24 03:26:49 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kinglong Mee X-Patchwork-Id: 4236511 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 57207BF90B for ; Sat, 24 May 2014 03:27:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 80D2B203DB for ; Sat, 24 May 2014 03:27:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B5E55203DA for ; Sat, 24 May 2014 03:27:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751168AbaEXD1K (ORCPT ); Fri, 23 May 2014 23:27:10 -0400 Received: from mail-oa0-f44.google.com ([209.85.219.44]:49225 "EHLO mail-oa0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751151AbaEXD1J (ORCPT ); Fri, 23 May 2014 23:27:09 -0400 Received: by mail-oa0-f44.google.com with SMTP id o6so6446533oag.3 for ; Fri, 23 May 2014 20:27:09 -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=w6teGt0GGMZgfgX4tVGEoH+BsksXA1VA65B9490dO9A=; b=sG0CzMZBbBQGVEEYyEVzJvDzosS6TcItAVXPxxZAzP+jgW9N6cyRmahp/2nl5ncnux FCI8zsFveNZha3dgICUp9aVJkzZ/1SGJcL8D/4d74SUwtxWrUrAn/MhvgzZ74yF8JURy zPVdoMLA+rDCE8Q/+Ewg1kMk5j318szAbtZK8vESWXWhJNlfqonFmeBg0Y3E6Z1PLfZ/ +H/ldIO5R7Tdl24Nle/v23EASCm5QXLRazqyj88o7sIbmMz1UqLZv+0/d7Ayvtr+qNqL LZXeTPTYxhviLiQ2YUHTVwisPWJuf2LunV9XHSPvCZ0fSysOIBTQZNASaWR2GvKnlPXV 0YiA== X-Received: by 10.182.20.169 with SMTP id o9mr9255482obe.59.1400902029144; Fri, 23 May 2014 20:27:09 -0700 (PDT) Received: from [192.168.31.158] ([118.117.113.227]) by mx.google.com with ESMTPSA id tz6sm9011045obc.10.2014.05.23.20.27.05 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 23 May 2014 20:27:08 -0700 (PDT) Message-ID: <53801179.8080502@gmail.com> Date: Sat, 24 May 2014 11:26:49 +0800 From: Kinglong Mee User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: "J. Bruce Fields" CC: Linux NFS Mailing List , kinglongmee@gmail.com Subject: [PATCH] NFSD: Using type of uint32_t for ex_nflavors instead of int Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 ex_nflavors can't be negative number, just defined by uint32_t. Signed-off-by: Kinglong Mee --- fs/nfsd/export.c | 7 ++++--- fs/nfsd/export.h | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c index 8513c59..9343ae2 100644 --- a/fs/nfsd/export.c +++ b/fs/nfsd/export.c @@ -437,13 +437,14 @@ out_free_all: static int secinfo_parse(char **mesg, char *buf, struct svc_export *exp) { - int listsize, err; struct exp_flavor_info *f; + u32 listsize; + int err; - err = get_int(mesg, &listsize); + err = get_uint(mesg, &listsize); if (err) return err; - if (listsize < 0 || listsize > MAX_SECINFO_LIST) + if (listsize > MAX_SECINFO_LIST) return -EINVAL; for (f = exp->ex_flavors; f < exp->ex_flavors + listsize; f++) { diff --git a/fs/nfsd/export.h b/fs/nfsd/export.h index d7939a6..11d03b9 100644 --- a/fs/nfsd/export.h +++ b/fs/nfsd/export.h @@ -53,7 +53,7 @@ struct svc_export { int ex_fsid; unsigned char * ex_uuid; /* 16 byte fsid */ struct nfsd4_fs_locations ex_fslocs; - int ex_nflavors; + uint32_t ex_nflavors; struct exp_flavor_info ex_flavors[MAX_SECINFO_LIST]; struct cache_detail *cd; };