Bug 1804786 - mount.glusterfs strips off "/" from subdir-mounts
Summary: mount.glusterfs strips off "/" from subdir-mounts
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: GlusterFS
Classification: Community
Component: scripts
Version: mainline
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: ---
Assignee: bugs@gluster.org
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-02-19 16:00 UTC by Andreas Loibl
Modified: 2020-02-22 16:25 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2020-02-22 16:25:40 UTC
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Gluster.org Gerrit 24157 0 None Merged mount.glusterfs: don't strip / from subdir-mounts 2020-02-22 16:25:39 UTC

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


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