Red Hat Bugzilla – Bug 1287763
glusterfs does not allow passing standard SElinux mount options to fuse
Last modified: 2016-09-20 00:29:38 EDT
Description of problem:
With older versions of gluster, say 3.5.3, glusterfs supports setting selinux context over fuse.glusterfs mountpoint. After 3.6.1, it throws an error : "Invalid option: context".
The problem is because of a change in mount.glusterfs script. With older versions, it works fine.
Version-Release number of selected component (if applicable):
Always in versions from 3.6
Steps to Reproduce:
It throws an error "Invalid option: context"
Inform FUSE that the glusterfs sub-filesystem supports SElinux while passing mount options and allow to set selinux context over the mountpoint.
When you set selinux context, the same can be verfied in /proc/mounts:
vm1:sel /qwe1 fuse.glusterfs rw,context=system_u:object_r:user_home_t:s0,relatime,user_id=0,group_id=0,default_ permissions,allow_other,max_read=131072 0 0
REVIEW: http://review.gluster.org/12858 (fuse: pass default SElinux mount options on to the kernel) posted (#1) for review on master by Niels de Vos (email@example.com)
REVIEW: http://review.gluster.org/12858 (fuse: pass default SElinux mount options on to the kernel) posted (#2) for review on master by Niels de Vos (firstname.lastname@example.org)
COMMIT: http://review.gluster.org/12858 committed in master by Niels de Vos (email@example.com)
Author: Niels de Vos <firstname.lastname@example.org>
Date: Wed Dec 2 21:19:56 2015 +0100
fuse: pass default SElinux mount options on to the kernel
In order to set default SElinux contexts on a Gluster mount, the
standard SElinux mount options need to be passed to the kernel. The
mount(8) manual page lists "context", "fscontext", "defcontext" and
"rootcontext" as valid options.
Signed-off-by: Niels de Vos <email@example.com>
Tested-by: NetBSD Build System <firstname.lastname@example.org>
Tested-by: Gluster Build System <email@example.com>
Reviewed-by: Humble Devassy Chirammal <firstname.lastname@example.org>
Reviewed-by: Manikandan Selvaganesh <email@example.com>
This bug is getting closed because a release has been made available that should address the reported issue. In case the problem is still not fixed with glusterfs-3.8.0, please open a new bug report.
glusterfs-3.8.0 has been announced on the Gluster mailinglists , packages for several distributions should become available in the near future. Keep an eye on the Gluster Users mailinglist  and the update infrastructure for your distribution.