Bug 1276534 - [exportfs] exportfs -u cannot unexport when the specified path involves a trailing "/"
Summary: [exportfs] exportfs -u cannot unexport when the specified path involves a tra...
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: nfs-utils
Version: 7.2
Hardware: Unspecified
OS: Unspecified
Target Milestone: rc
: ---
Assignee: Steve Dickson
QA Contact: Yongcheng Yang
Depends On:
Blocks: 1276538
TreeView+ depends on / blocked
Reported: 2015-10-30 03:47 UTC by Yongcheng Yang
Modified: 2016-11-04 05:01 UTC (History)
1 user (show)

Fixed In Version: nfs-utils-1.3.0-0.25.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1276538 (view as bug list)
Last Closed: 2016-11-04 05:01:11 UTC
Target Upstream Version:

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:2383 0 normal SHIPPED_LIVE nfs-utils bug fix and enhancement update 2016-11-03 13:53:02 UTC

Description Yongcheng Yang 2015-10-30 03:47:07 UTC
Description of problem:
When using "exportfs -u" to unexport just one directory, it always failed when the specified path involves a trailing "/", with error:
exportfs: Could not find 'client.example.com:/export/' to unexport.

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

How reproducible:

Steps to Reproduce:
1. exportfs -v $HOSTNAME:/export/
2. exportfs -u client2.example.com:/export/

Actual results:
[root@hp-dl388g8-17 ~]# exportfs -ua
[root@hp-dl388g8-17 ~]# exportfs -v $HOSTNAME:/export/
exporting hp-dl388g8-17.rhts.eng.pek2.redhat.com:/export/
[root@hp-dl388g8-17 ~]# exportfs -v
/export       	hp-dl388g8-17.rhts.eng.pek2.redhat.com(ro,wdelay,root_squash,no_subtree_check,sec=sys,ro,secure,root_squash,no_all_squash)
[root@hp-dl388g8-17 ~]# exportfs -u hp-dl388g8-17.rhts.eng.pek2.redhat.com:/export/ <<<<<<<<<<<<<<<<<<<<< failed
exportfs: Could not find 'hp-dl388g8-17.rhts.eng.pek2.redhat.com:/export/' to unexport.
[root@hp-dl388g8-17 ~]# echo $?
[root@hp-dl388g8-17 ~]# exportfs -v
/export       	hp-dl388g8-17.rhts.eng.pek2.redhat.com(ro,wdelay,root_squash,no_subtree_check,sec=sys,ro,secure,root_squash,no_all_squash)
[root@hp-dl388g8-17 ~]# exportfs -uv hp-dl388g8-17.rhts.eng.pek2.redhat.com:/export  <<<<<<<<<<<<<<<<<<<< success without trailing "/"
unexporting hp-dl388g8-17.rhts.eng.pek2.redhat.com:/export
[root@hp-dl388g8-17 ~]# echo $?
[root@hp-dl388g8-17 ~]# exportfs -v
[root@hp-dl388g8-17 ~]# 
[root@hp-dl388g8-17 ~]# rpm -q nfs-utils
[root@hp-dl388g8-17 ~]# 

Expected results:
Unexport success

Additional info:
Can reproduced with RHEL6 too, will file another bug

Comment 2 Yongcheng Yang 2016-05-03 06:15:12 UTC
commit a9a7728d874398c855e386d9583cf05e681ecc1c
Author: Yongcheng Yang <yongcheng.yang@gmail.com>
Date:   Fri Dec 11 11:01:17 2015 -0500

    exportfs: Deal with path's trailing "/" in unexportfs_parsed()
    When unexport directory, it's possible that the specified path ends with
    a '/'. So we need to deal with it to find the matched entry.
    If not, there will be error like "Could not find '*:/some_path/' to

Comment 5 Yongcheng Yang 2016-05-30 08:45:11 UTC
Move to VERIFIED as comment 4 and continue to run the automatic case.

Comment 7 errata-xmlrpc 2016-11-04 05:01:11 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.


Note You need to log in before you can comment on or make changes to this bug.