RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1820523 - exportfs fails to 'monitor' path that contains symlinks
Summary: exportfs fails to 'monitor' path that contains symlinks
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: resource-agents
Version: 8.2
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: 8.3
Assignee: Oyvind Albrigtsen
QA Contact: cluster-qe@redhat.com
URL:
Whiteboard:
Depends On: 1601950
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-04-03 09:40 UTC by Oyvind Albrigtsen
Modified: 2020-11-04 02:19 UTC (History)
10 users (show)

Fixed In Version: resource-agents-4.1.1-54.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1601950
Environment:
Last Closed: 2020-11-04 02:19:19 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github ClusterLabs resource-agents pull 1492 0 None closed exportfs: add symlink support 2020-11-06 18:12:07 UTC
Red Hat Knowledge Base (Solution) 3531571 0 None None None 2020-04-03 21:25:43 UTC

Description Oyvind Albrigtsen 2020-04-03 09:40:50 UTC
+++ This bug was initially created as a clone of Bug #1601950 +++

== Description of problem:
exportfs fails to 'monitor' exports path that contains symlinks.

== Version-Release number of selected component (if applicable):
resource-agents-3.9.5-124.el7.x86_64 (RHEL 7.5)
nfs-utils-1.3.0-0.54.el7.x86_64 (RHEL 7.5)

== How reproducible:
Always

== Steps to Reproduce:
1. Create path for export
  # mkdir -p /exports/test
2. Create symlink for the exported path
  # ln -s /exports/test /exports/something
3. Create group with 'nfsserver' resource
  # pcs resource create nfs-server nfsserver --group nfsgroup
4. Add 'exportfs' cluster resource that will export the path defined by symlink (/exports/something) to this group
  # pcs resource create nfsexport_something exportfs clientspec="*" directory=/exports/something fsid=1 --group nfsgroup

== Actual results:
nfsexport_something 'start' succeeds. First 'monitor' of nfsexport_something fails. Resource is restarted and fails in same way repeatedly.

# /var/log/cluster/corosync.log
...
Jul 17 15:39:01 [1542] fvm-rhel-52       lrmd:     info: log_execute:       executing - rsc:nfsexport_something action:start call_id:230
exportfs(nfsexport_something)[10453]:   2018/07/17_15:39:01 INFO: Directory /exports/something is not exported to * (stopped).
exportfs(nfsexport_something)[10453]:   2018/07/17_15:39:01 INFO: Exporting file system ...
exportfs(nfsexport_something)[10453]:   2018/07/17_15:39:01 INFO: exportfs: No file systems exported! exporting *:/exports/something
exportfs(nfsexport_something)[10453]:   2018/07/17_15:39:01 WARNING: rmtab backup /exports/something/.rmtab not found or not readable.
exportfs(nfsexport_something)[10453]:   2018/07/17_15:39:01 INFO: File system exported
Jul 17 15:39:01 [1542] fvm-rhel-52       lrmd:     info: log_finished:      finished - rsc:nfsexport_something action:start call_id:230 pid:10453 exit-code:0 exec-time:233ms queue-time:0ms
...
exportfs(nfsexport_something)[10529]:   2018/07/17_15:39:01 INFO: Directory /exports/something is not exported to * (stopped).
...

# exportfs
/exports/test   <world>

== Expected results:
nfsexport_something is properly started and works.

== Current workaround:
Don't use path containing symlinks for 'directory' attribute of 'exportfs' resource agent.

== Additional info:
The issue seems to be that 'exportfs' resource agent relies on the output from 'exportfs' command
that resolves all paths containing symlinks to paths without symlinks and that is provided in output of 'exportfs'.
Note: the resolved path is provided only in the 'exportfs' command when asking which paths are exported. During the
"add of the export path" the same verbatim path provided as parameter is used so we can't tell if the path got changed
during the add of the exported path.

Attached to this BZ is path with proposed fix for the 'exportfs' resource agent from resource-agents-3.9.5-124.el7.x86_64 package
that uses 'readlink' to resolve the path provided to resource agent into path that is then shown by the 'exportfs' command.

Note that this patch will not work with upstream version of 'exportfs' resource agent which has ability to export multiple
directories specified in the 'directory' attribute separated by space. Most probably the check could be implemented there
in 'forall' function where 'directory' attribute is being enumerated and it executes operations on one directory only.
https://github.com/ClusterLabs/resource-agents/blob/master/heartbeat/exportfs#L202

=== resource-agents-3.9.5-124.el7.x86_64
# pcs resource debug-start nfsexport_something
Operation start for nfsexport_something (ocf:heartbeat:exportfs) returned 0
 >  stderr: INFO: Directory /exports/something is not exported to * (stopped).
 >  stderr: INFO: Exporting file system ...
 >  stderr: INFO: exportfs: No file systems exported! exporting *:/exports/something
 >  stderr: WARNING: rmtab backup /exports/something/.rmtab not found or not readable.
 >  stderr: INFO: File system exported
# exportfs
/exports/test   <world>
# pcs resource debug-monitor nfsexport_something
Error performing operation: Argument list too long
Operation monitor for nfsexport_something (ocf:heartbeat:exportfs) returned 7
 >  stderr: INFO: Directory /exports/something is not exported to * (stopped).
# pcs resource debug-stop nfsexport_something
Operation stop for nfsexport_something (ocf:heartbeat:exportfs) returned 0
 >  stderr: INFO: Directory /exports/something is not exported to * (stopped).
 >  stderr: DEBUG: /exports/something not exported
# exportfs
/exports/test   <world>

== patched version resource-agents-3.9.5-124.el7.x86_64
[root@fvm-rhel-7-3-53 ~]# pcs resource debug-start nfsexport_something
Operation start for nfsexport_something (ocf:heartbeat:exportfs) returned 0
 >  stderr: DEBUG: Resolved path without symlinks: /exports/test
 >  stderr: INFO: Directory /exports/test is not exported to * (stopped).
 >  stderr: INFO: Exporting file system ...
 >  stderr: INFO: exportfs: No file systems exported! exporting *:/exports/test
 >  stderr: WARNING: rmtab backup /exports/test/.rmtab not found or not readable.
 >  stderr: INFO: File system exported
# exportfs
/exports/test   <world>
# pcs resource debug-monitor nfsexport_something
Operation monitor for nfsexport_something (ocf:heartbeat:exportfs) returned 0
 >  stderr: DEBUG: Resolved path without symlinks: /exports/test
# pcs resource debug-stop nfsexport_something
Operation stop for nfsexport_something (ocf:heartbeat:exportfs) returned 0
 >  stderr: DEBUG: Resolved path without symlinks: /exports/test
 >  stderr: INFO: Un-exporting file system ...
 >  stderr: INFO: unexporting *:/exports/test
 >  stderr: INFO: Un-exported file system
# exportfs
(empty output)

Comment 1 Patrik Hagara 2020-04-03 09:44:10 UTC
qa_ack+, reproducer in description

Comment 2 Oyvind Albrigtsen 2020-05-05 12:24:16 UTC
https://github.com/ClusterLabs/resource-agents/pull/1492

Comment 10 errata-xmlrpc 2020-11-04 02:19:19 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 (Low: resource-agents security and bug fix update), 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/RHSA-2020:4605


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