Bug 852754

Summary: [PATCH] It's not possible to use mount/fuse with certain mount options, such as "context"
Product: [Community] GlusterFS Reporter: Lubomir Rintel (GoodData, inactive) <lubo.rintel>
Component: fuseAssignee: Lubomir Rintel (GoodData, inactive) <lubo.rintel>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 3.3.0CC: gluster-bugs, ndevos
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: glusterfs-3.4.0 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-07-24 17:25:26 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 Lubomir Rintel (GoodData, inactive) 2012-08-29 13:46:25 UTC
Description of problem:

GlusterFS ignores the common options. (see comment in patch for explanation why is that not a good idea).

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

Since this is more of a feature request than a regression, all versions are likely affected. I'm hitting the problem with 3.3.0, the patch applies to master as well.

How reproducible:

Everytime.

Steps to Reproduce:

~♥ mount -t glusterfs -o context=system_u:object_r:gdc_export_rw_t:s0 rc-dfs01.int.getgooddata.com:Exporter /var/gdc/export
  
Actual results:

* A warning message:

unknown option context (ignored)

* Option not applied:

~♥ cat /proc/mounts |grep Exporter
rc-dfs01.int.getgooddata.com:Exporter /var/gdc/export fuse.glusterfs rw,relatime,user_id=0,group_id=0,allow_other,max_read=131072 0 0

* And indeed not in effect:

~♥ ls -ldZ /var/gdc/export
drwxr-xr-x. root root system_u:object_r:fusefs_t:s0    /var/gdc/export

Expected results:

* Option applied:

~♥ cat /proc/mounts |grep Exporter
rc-dfs01.int.getgooddata.com:Exporter /var/gdc/export fuse.glusterfs rw,relatime,user_id=0,group_id=0,allow_other,max_read=131072,context=system_u:object_r:gdc_export_rw_t:s0 0 0

* And working well:

~♥ ls -ldZ /var/gdc/export
drwxr-xr-x. root root system_u:object_r:gdc_export_rw_t    /var/gdc/export

Additional info:

I'll be submitting the patch to gerrit shortly, once I have a bug number. I guess it will be linked here, it contains a descriptive comment.

Comment 1 Lubomir Rintel (GoodData, inactive) 2012-08-29 13:56:17 UTC
The review is here: http://review.gluster.org/#change,3871

Comment 2 Niels de Vos 2012-10-31 09:51:25 UTC
This change has already been included in master on 16 september:

commit ab039cc10f8493c6964ddc5b1510219708a31c60
Author: Lubomir Rintel <lubo.rintel>
Date:   Wed Aug 29 14:55:13 2012 +0200

    fuse-bridge: Pass unknown option down to fuse
    
    In Linux, certain "filesystem-specific" options (passed in string form in last
    argument to mount(2)), such as "rootcontext" or "context" are in fact common to
    all filesystems, including fuse. We should pass them down to the actual
    mount(2) call untouched.
    
    This is achieved by adding "fuse-mountopts" option to mount/fuse translator and
    adjusting the mount helper to propagate it with unrecognized options as they
    are encountered.
    
    BUG: 852754
    Change-Id: I309203090c02025334561be235864d8d04e4159b
    Signed-off-by: Lubomir Rintel <lubo.rintel>
    Reviewed-on: http://review.gluster.org/3871
    Tested-by: Gluster Build System <jenkins.com>
    Reviewed-by: Anand Avati <avati>

Comment 3 Vijay Bellur 2013-02-08 02:18:14 UTC
CHANGE: http://review.gluster.org/3877 (fuse: log options passed to fuse when mount fails) merged in master by Anand Avati (avati)