From patchwork Fri Nov 18 08:58:43 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jianhong.Yin" X-Patchwork-Id: 9435957 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 2149560469 for ; Fri, 18 Nov 2016 08:58:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1917F294F5 for ; Fri, 18 Nov 2016 08:58:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0C576294FF; Fri, 18 Nov 2016 08:58:55 +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.9 required=2.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI 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 93302294F5 for ; Fri, 18 Nov 2016 08:58:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751527AbcKRI6w (ORCPT ); Fri, 18 Nov 2016 03:58:52 -0500 Received: from mx1.redhat.com ([209.132.183.28]:54242 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751495AbcKRI6w (ORCPT ); Fri, 18 Nov 2016 03:58:52 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id F3449C04B317; Fri, 18 Nov 2016 08:58:50 +0000 (UTC) Received: from dhcp-12-159.nay.redhat.com (dhcp-12-159.nay.redhat.com [10.66.12.159]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id uAI8wnmN021277; Fri, 18 Nov 2016 03:58:49 -0500 From: "Jianhong.Yin" To: linux-nfs@vger.kernel.org Cc: steved@redhat.com, "Jianhong.Yin" Subject: [PATCH] nfs-utils: exportfs remove redundant exports options output Date: Fri, 18 Nov 2016 16:58:43 +0800 Message-Id: <1479459523-7649-1-git-send-email-yin-jianhong@163.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Fri, 18 Nov 2016 08:58:51 +0000 (UTC) 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 before this commit, run 'exportfs -s' will output some options more than one time. for example: /path *(rw,no_root_squash,rw,secure,no_root_squash,no_all_squash) the options rw,no_root_squash,etc will be print twice. the reason is secinfo_show() will show these security options again this patch remove these redundant outputs. Signed-off-by: Jianhong Yin --- utils/exportfs/exportfs.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/utils/exportfs/exportfs.c b/utils/exportfs/exportfs.c index 98368a5..b11f06b 100644 --- a/utils/exportfs/exportfs.c +++ b/utils/exportfs/exportfs.c @@ -747,26 +747,20 @@ dump(int verbose, int export_format) continue; } c = '('; - if (ep->e_flags & NFSEXP_READONLY) - c = dumpopt(c, "ro"); - else - c = dumpopt(c, "rw"); if (ep->e_flags & NFSEXP_ASYNC) c = dumpopt(c, "async"); + else + c = dumpopt(c, "sync"); if (ep->e_flags & NFSEXP_GATHERED_WRITES) c = dumpopt(c, "wdelay"); + else + c = dumpopt(c, "no_wdelay"); if (ep->e_flags & NFSEXP_NOHIDE) c = dumpopt(c, "nohide"); + else + c = dumpopt(c, "hide"); if (ep->e_flags & NFSEXP_CROSSMOUNT) c = dumpopt(c, "crossmnt"); - if (ep->e_flags & NFSEXP_INSECURE_PORT) - c = dumpopt(c, "insecure"); - if (ep->e_flags & NFSEXP_ROOTSQUASH) - c = dumpopt(c, "root_squash"); - else - c = dumpopt(c, "no_root_squash"); - if (ep->e_flags & NFSEXP_ALLSQUASH) - c = dumpopt(c, "all_squash"); if (ep->e_flags & NFSEXP_NOSUBTREECHECK) c = dumpopt(c, "no_subtree_check"); if (ep->e_flags & NFSEXP_NOAUTHNLM)