Bug 1311236 - Bug in /sbin/mount.glusterfs with option before -o
Bug in /sbin/mount.glusterfs with option before -o
Status: CLOSED DUPLICATE of bug 1297209
Product: GlusterFS
Classification: Community
Component: fuse (Show other bugs)
3.7.8
Unspecified Linux
medium Severity high
: ---
: ---
Assigned To: bugs@gluster.org
: Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-02-23 11:47 EST by Sebastien Delcroix
Modified: 2016-03-02 05:53 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-03-02 05:53:39 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Sebastien Delcroix 2016-02-23 11:47:59 EST
Description of problem:

When you use an option before -o (eg -n) "mount" options are suppressed 

When you use systemd to mount gluster filesystem it adds "-n" option before "-o" and filesystem are not mounted correctly.

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


How reproducible:

mount.glusterfs gluster-a:/gv-app2 /var/www -n -o rw,acl,direct-io-mode=disable,backupvolfile-server=gluster-b,_netdev

Steps to Reproduce:
1.
2.
3.

Actual results:

Does not mount with acl option

Expected results:

Moutn with acl option

Additional info:

I've found the issue :
in /sbin/mount.glusterfs this part of code use "shift" and it should not have to

--8<----------------------------
while getopts "Vo:hn" opt; do
        case "${opt}" in
            o)
                parse_options ${OPTARG};
                shift 2;
                ;;
            n)
                shift 1;
                ;;
            V)
                ${cmd_line} -V;
                exit 0;
                ;;
            h)
                print_usage;
                exit 0;
                ;;
            ?)
                print_usage;
                exit 0;
                ;;
        esac
    done

--8<----------------------------

you should patch with this

--8<----------------------------
--- /sbin/mount.glusterfs       2016-02-23 16:19:16.192588339 +0100
+++ /sbin/mount.glusterfs.ori   2016-02-09 07:30:14.000000000 +0100
@@ -570,8 +570,10 @@
         case "${opt}" in
             o)
                 parse_options ${OPTARG};
+               shift 2;
                 ;;
             n)
+               shift 1;
                 ;;
             V)
                 ${cmd_line} -V;
--8<----------------------------

"shift" is already handled by getopts.
Comment 1 Niels de Vos 2016-03-02 05:53:39 EST

*** This bug has been marked as a duplicate of bug 1297209 ***

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