From patchwork Fri May 23 12:01:47 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kinglong Mee X-Patchwork-Id: 4231921 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 9F61F9F1CD for ; Fri, 23 May 2014 12:02:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D1C2A2039C for ; Fri, 23 May 2014 12:02:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BEEBF2022A for ; Fri, 23 May 2014 12:02:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751413AbaEWMCJ (ORCPT ); Fri, 23 May 2014 08:02:09 -0400 Received: from mail-qg0-f46.google.com ([209.85.192.46]:53284 "EHLO mail-qg0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751397AbaEWMCJ (ORCPT ); Fri, 23 May 2014 08:02:09 -0400 Received: by mail-qg0-f46.google.com with SMTP id q108so7634119qgd.5 for ; Fri, 23 May 2014 05:02:08 -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=vcPfzHNN2pbWq4g6m+JLCSgCMXclz2MgVu+Iox5NZFA=; b=FQrtiUj1wfJkgQqO+CmMeomMTl1WDs+j7BKr1UrIjs3zjxdkUbmM9xToBRGmnU/nb/ 0IkFkBqSL7e7p2DXRtxIfhZiiUCBVMqCkjIK7n/NCyvq/5Difbhk6+XD9nNLnHuwh2Hk ZtYT0Gs5DGXkZO2DubN5VZiBknemCii1csTgSpGBdvvd1GTwMae8YYjFhd0v8sDbedRI 1ahhdZxnm6LrodD19q3QMAYy+0+bTEYA2BHZr3d4+3rrmIt7Ofvp3Yc+IeWk+iOALUw1 Pr5VEdxCV1N71wjeWarjj5hX54QXdBqC4m6S8E3ECwW1eg22nWEE/f6v/ConlAJ1vabx Tnyw== X-Received: by 10.140.32.97 with SMTP id g88mr5352692qgg.17.1400846527351; Fri, 23 May 2014 05:02:07 -0700 (PDT) Received: from [192.168.31.158] ([118.117.113.227]) by mx.google.com with ESMTPSA id b5sm4575230qar.1.2014.05.23.05.02.03 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 23 May 2014 05:02:06 -0700 (PDT) Message-ID: <537F38AB.10102@gmail.com> Date: Fri, 23 May 2014 20:01:47 +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 4/4] NFSD: Ignore and warn once for more fslocs or more uuids 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 If mountd writes more fslocs or more uuids, just ignore and warn once. Signed-off-by: Kinglong Mee --- fs/nfsd/export.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c index 90d37b6..1d56ae3 100644 --- a/fs/nfsd/export.c +++ b/fs/nfsd/export.c @@ -394,6 +394,12 @@ fsloc_parse(char **mesg, char *buf, struct nfsd4_fs_locations *fsloc) int len; int migrated, i, err; + /* utils writes more fslocs than one */ + if (fsloc->locations) { + WARN_ON_ONCE(1); + return 0; + } + /* listsize */ err = get_uint(mesg, &fsloc->locations_count); if (err) @@ -485,6 +491,12 @@ uuid_parse(char **mesg, char *buf, unsigned char **puuid) { int len; + /* utils writes more uuid than one */ + if (*puuid) { + WARN_ON_ONCE(1); + return 0; + } + /* expect a 16 byte uuid encoded as \xXXXX... */ len = qword_get(mesg, buf, PAGE_SIZE); if (len != EX_UUID_LEN)