Bug 1311236 - Bug in /sbin/mount.glusterfs with option before -o
Summary: Bug in /sbin/mount.glusterfs with option before -o
Keywords:
Status: CLOSED DUPLICATE of bug 1297209
Alias: None
Product: GlusterFS
Classification: Community
Component: fuse
Version: 3.7.8
Hardware: Unspecified
OS: Linux
medium
high
Target Milestone: ---
Assignee: bugs@gluster.org
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-02-23 16:47 UTC by Sebastien Delcroix
Modified: 2016-03-02 10:53 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2016-03-02 10:53:39 UTC
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Embargoed:


Attachments (Terms of Use)

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 ***


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