Bug 852754 - [PATCH] It's not possible to use mount/fuse with certain mount options, such as "context"
Summary: [PATCH] It's not possible to use mount/fuse with certain mount options, such ...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: GlusterFS
Classification: Community
Component: fuse
Version: 3.3.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Lubomir Rintel (GoodData, inactive)
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-08-29 13:46 UTC by Lubomir Rintel (GoodData, inactive)
Modified: 2013-07-24 17:25 UTC (History)
2 users (show)

Fixed In Version: glusterfs-3.4.0
Clone Of:
Environment:
Last Closed: 2013-07-24 17:25:26 UTC
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Embargoed:


Attachments (Terms of Use)

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)


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