[PATCH] exportfs: move ro/rw option back to secinfo_flag_displaymap table

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



according https://bugzilla.redhat.com/show_bug.cgi?id=1532688#c3
ro/rw options should be in secinfo_flag_displaymap[]

test pass:
'''
[yjh@test ~]$ cat /etc/exports
/export_test    127.0.0.1(rw,wdelay,no_root_squash,no_subtree_check,sec=sys,root_squash,all_squash,sec=krb5,ro,root_squash,no_all_squash,sec=krb5i,rw,root_squash,no_all_squash,sec=krb5p,no_root_squash,no_all_squash)
[yjh@test ~]$ sudo service nfs restart
Redirecting to /bin/systemctl restart nfs.service
[yjh@test ~]$ sudo exportfs -v
/export_test    127.0.0.1(sync,wdelay,hide,no_subtree_check,sec=sys,rw,secure,root_squash,all_squash,sec=krb5,ro,secure,root_squash,no_all_squash,sec=krb5i,rw,secure,root_squash,no_all_squash,sec=krb5p,rw,secure,no_root_squash,no_all_squash)
'''

Signed-off-by: Jianhong Yin <yin-jianhong@xxxxxxx>
---
 support/nfs/exports.c     | 1 +
 utils/exportfs/exportfs.c | 4 ----
 2 files changed, 1 insertion(+), 4 deletions(-)

diff --git a/support/nfs/exports.c b/support/nfs/exports.c
index 92bd6e6..b59d187 100644
--- a/support/nfs/exports.c
+++ b/support/nfs/exports.c
@@ -197,6 +197,7 @@ static const struct secinfo_flag_displaymap {
 	const char *set;
 	const char *unset;
 } secinfo_flag_displaymap[] = {
+	{ NFSEXP_READONLY, "ro", "rw" },
 	{ NFSEXP_INSECURE_PORT, "insecure", "secure" },
 	{ NFSEXP_ROOTSQUASH, "root_squash", "no_root_squash" },
 	{ NFSEXP_ALLSQUASH, "all_squash", "no_all_squash" },
diff --git a/utils/exportfs/exportfs.c b/utils/exportfs/exportfs.c
index 448f195..cd3c979 100644
--- a/utils/exportfs/exportfs.c
+++ b/utils/exportfs/exportfs.c
@@ -695,10 +695,6 @@ 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
-- 
2.14.3

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux