From ab039cc10f8493c6964ddc5b1510219708a31c60 Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Wed, 29 Aug 2012 14:55:13 +0200 Subject: 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 Reviewed-on: http://review.gluster.org/3871 Tested-by: Gluster Build System Reviewed-by: Anand Avati --- xlators/mount/fuse/utils/mount.glusterfs.in | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'xlators/mount/fuse/utils/mount.glusterfs.in') diff --git a/xlators/mount/fuse/utils/mount.glusterfs.in b/xlators/mount/fuse/utils/mount.glusterfs.in index 9b9c0f81b..0d92bfbd5 100755 --- a/xlators/mount/fuse/utils/mount.glusterfs.in +++ b/xlators/mount/fuse/utils/mount.glusterfs.in @@ -156,6 +156,10 @@ start_glusterfs () cmd_line=$(echo "$cmd_line --congestion-threshold=$cong_threshold"); fi + if [ -n "$fuse_mountopts" ]; then + cmd_line=$(echo "$cmd_line --fuse-mountopts=$fuse_mountopts"); + fi + # for rdma volume, we have to fetch volfile with '.rdma' added # to volume name, so that it fetches the right client vol file volume_id_rdma=""; @@ -190,6 +194,10 @@ start_glusterfs () cmd_line=$(echo "$cmd_line --volfile=$volfile_loc"); fi + if [ -n "$fuse_mountopts" ]; then + cmd_line=$(echo "$cmd_line --fuse-mountopts=$fuse_mountopts"); + fi + cmd_line=$(echo "$cmd_line $mount_point"); err=0; $cmd_line; @@ -353,7 +361,12 @@ main () "gid-timeout") gid_timeout=$value ;; "background-qlen") bg_qlen=$value ;; "congestion-threshold") cong_threshold=$value ;; - *) echo "unknown option $key (ignored)" ;; + "fuse-mountopts") fuse_mountopts=$value ;; + *) + # Passthru + [ -z "$fuse_mountopts" ] || fuse_mountopts="$fuse_mountopts," + fuse_mountopts="$fuse_mountopts$pair" + ;; esac esac done @@ -422,4 +435,3 @@ main () } _init "$@" && main "$@"; - -- cgit