Bug 1396402

Summary: [exportfs] exportfs -s output some exports options twice, but can not output some options like sync,hide,no_wdlay
Product: Red Hat Enterprise Linux 7 Reporter: JianHong Yin <jiyin>
Component: nfs-utilsAssignee: Steve Dickson <steved>
Status: CLOSED ERRATA QA Contact: ChunYu Wang <chunwang>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 7.4CC: chunwang, steved, yoyang
Target Milestone: rcKeywords: EasyFix, Patch
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: nfs-utils-1.3.0-0.36.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-08-01 19:48:51 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description JianHong Yin 2016-11-18 09:15:30 UTC
Description of problem:

As Subject/Summary:
'exportfs -s' always output some exports options twice

[yjh@dhcp-11-111 nfs-utils.up]$ sudo systemctl start nfs
[yjh@dhcp-11-111 nfs-utils.up]$ sudo exportfs -s 
/expdir  *(rw,wdelay,no_root_squash,no_subtree_check,sec=sys,rw,secure,no_root_squash,no_all_squash)

Version-Release number of selected component (if applicable):
all verions

How reproducible:
always

Steps to Reproduce:
$ cat /etc/exports
/expdir   *(rw,sync,no_root_squash)
$ sudo systemctl start nfs
$ sudo exportfs -s
/expdir  *(rw,wdelay,no_root_squash,no_subtree_check,sec=sys,rw,secure,no_root_squash,no_all_squash)

Actual results:
exportfs -s output some exports options twice, but can not output some options like sync,hide,no_wdlay

Expected results:
remove redundant options, and add the missing options

Additional info:

Comment 1 JianHong Yin 2016-11-18 09:17:00 UTC
patch: http://www.spinics.net/lists/linux-nfs/msg60781.html

Comment 2 ChunYu Wang 2017-02-07 12:18:58 UTC
Hi, Steve,

Patch in Comment 1 provided by Jianhong seems workable to solve this problem, will we fix it in next versions?


Also, some opitions appear twice in /var/lib/nfs/etab:
-bash-4.3# strace exportfs -s 2>&1 |fgrep "etab"
open("/var/lib/nfs/.etab.lock", O_RDONLY|O_CREAT, 0600) = 3
open("/var/lib/nfs/etab", O_RDONLY)     = 4

[chunwang@fs-qe ~]$ cat /var/lib/nfs/etab | head -1 | sed 's/^.*(//;s/)//;s/,/\n/g' |sort
acl
anongid=65534
anonuid=65534
hide
no_all_squash
no_all_squash
nocrossmnt
no_pnfs
no_root_squash
no_root_squash
no_subtree_check
rw
rw
sec=sys
secure
secure
secure_locks
sync
wdelay
[chunwang@fs-qe ~]$ uname -r 
3.10.0-327.el7.x86_64


Regards,
ChunYu Wang

Comment 3 Yongcheng Yang 2017-02-07 12:33:29 UTC
(In reply to ChunYu Wang from comment #2)
> Hi, Steve,
> 
> Patch in Comment 1 provided by Jianhong seems workable to solve this
> problem, will we fix it in next versions?
> 
It has already been merged into upstream as:

commit 37c07fa0b74a29dea18d359068e9189c5159c49d
Author: Jianhong Yin <yin-jianhong>
Date:   Tue Nov 22 14:03:37 2016 -0500

    exportfs: remove redundant exports options output

Comment 6 ChunYu Wang 2017-03-29 01:56:33 UTC
Moved to VERIFIED according to comment 4, will keep an eye on related issues during future tests.

Thanks,
ChunYu Wang

Comment 7 errata-xmlrpc 2017-08-01 19:48:51 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2017:2233