nfs-utils: exportfs remove redundant exports options output
diff mbox

Message ID 1479459523-7649-1-git-send-email-yin-jianhong@163.com
State New
Headers show

Commit Message

Jianhong.Yin Nov. 18, 2016, 8:58 a.m. UTC
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 <yin-jianhong@163.com>
---
 utils/exportfs/exportfs.c | 18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)

Comments

Steve Dickson Nov. 22, 2016, 7:05 p.m. UTC | #1
On 11/18/2016 03:58 AM, Jianhong.Yin wrote:
> 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 <yin-jianhong@163.com>
Committed!

steved.

> ---
>  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)
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch
diff mbox

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)