Bug 1311236

Summary: Bug in /sbin/mount.glusterfs with option before -o
Product: [Community] GlusterFS Reporter: Sebastien Delcroix <s.delcroix>
Component: fuseAssignee: bugs <bugs>
Status: CLOSED DUPLICATE QA Contact:
Severity: high Docs Contact:
Priority: medium    
Version: 3.7.8CC: bugs, hgowtham, s.delcroix
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-03-02 10:53:39 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 Sebastien Delcroix 2016-02-23 16:47:59 UTC
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 10:53:39 UTC

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