Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1804786

Summary: mount.glusterfs strips off "/" from subdir-mounts
Product: [Community] GlusterFS Reporter: Andreas Loibl <mail>
Component: scriptsAssignee: bugs <bugs>
Status: CLOSED NEXTRELEASE QA Contact:
Severity: low Docs Contact:
Priority: unspecified    
Version: mainlineCC: bugs
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: ---
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-02-22 16:25:40 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:
Embargoed:

Description Andreas Loibl 2020-02-19 16:00:03 UTC
Description of problem:
the mount.glusterfs code to handle subdir-mounts always strips off the "/" in front of the volume name,
so when mounting "server:/volname/subdir" becomes "server:volname/subdir"

Version-Release number of selected component (if applicable):
every release since v3.13.0beta – as commit 590ae48c6 introduced this behaviour initially here:
https://github.com/gluster/glusterfs/commit/590ae48c6#diff-7829823331339149cb845ff035efff54R667-R669

How reproducible: 100%

Steps to Reproduce:
1. mount -t glusterfs server:/volname/subdir /mnt
2. findmnt -no SOURCE /mnt

Actual results:
server:volname/subdir

Expected results:
server:/volname/subdir

Additional info:
it is common for configuration management and other scripts to expect that the device-string supplied to mount matches the source that actually gets mounted

ansible for example expects ":/" to appear in the device of a network mount, otherwise the mount is ignored:
https://github.com/ansible/ansible/blob/devel/lib/ansible/module_utils/facts/hardware/linux.py#L505

(ugly) workaround that prevents "/" from being stripped:
# mount -t glusterfs -osubdir-mount=subdir server:/volname /mnt
# findmnt -no SOURCE /mnt
server:/volname/subdir

(this workaround is another proof of the inconsistent handling of subdir-mounts and why this issue should be considered a bug)

Comment 1 Worker Ant 2020-02-20 13:13:01 UTC
REVIEW: https://review.gluster.org/24157 (mount.glusterfs: don't strip / from subdir-mounts) posted (#1) for review on master by None

Comment 2 Worker Ant 2020-02-22 16:25:40 UTC
REVIEW: https://review.gluster.org/24157 (mount.glusterfs: don't strip / from subdir-mounts) merged (#1) on master by None