From a5b352a703574b894e0b7cdbf16bea637dab75e8 Mon Sep 17 00:00:00 2001 From: Niels de Vos Date: Sun, 3 Jan 2016 12:57:29 +0100 Subject: fuse: pass standard mount options to the kernel Some of the default mount options were made invalid with glusterfs-3.6. The /sbin/mount.glusterfs script changed heavily and now requires all valid mount options to be listed. Earlier versions (glusterfs-3.5 and before) passed all unknown mount options on to fuse. With this change, all mount options from 'man 8 mount' are explicitly included in the /sbin/mount.glusterfs script. Some of the options are marked with TODO, these are not commonly used and may require some additional support in Gluster/FUSE too. BUG: 1294809 Change-Id: Ic312140d7318b54523996bb08772ff065af7eb27 Signed-off-by: Niels de Vos Reviewed-on: http://review.gluster.org/13166 Reviewed-by: Kaleb KEITHLEY Smoke: Gluster Build System CentOS-regression: Gluster Build System NetBSD-regression: NetBSD Build System --- xlators/mount/fuse/utils/mount.glusterfs.in | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/xlators/mount/fuse/utils/mount.glusterfs.in b/xlators/mount/fuse/utils/mount.glusterfs.in index 7f314da69ec..32168df5a33 100755 --- a/xlators/mount/fuse/utils/mount.glusterfs.in +++ b/xlators/mount/fuse/utils/mount.glusterfs.in @@ -472,6 +472,9 @@ with_options() [ -z "$fuse_mountopts" ] || fuse_mountopts="$fuse_mountopts," fuse_mountopts="${fuse_mountopts}$key=\"$value\"" ;; + x-*) + # comments or userspace application-specific options, drop them + ;; *) warn "Invalid option: $key" exit 1 @@ -516,11 +519,30 @@ without_options() # "mount -t glusterfs" sends this, but it's useless. "rw") ;; + # TODO: not sure how to handle this yet + "async"|"sync"|"dirsync"|\ + "mand"|"nomand"|\ + "silent"|"loud"|\ + "iversion"|"noiversion"|\ + "nofail") + warn "mount option '${option}' is not handled (yet?)" + ;; + # standard mount options to pass to the kernel + "atime"|"noatime"|"diratime"|"nodiratime"|\ + "relatime"|"norelatime"|\ + "strictatime"|"nostrictatime"|"lazyatime"|"nolazyatime"|\ + "dev"|"nodev"|"exec"|"noexec"|"suid"|"nosuid") + [ -z "$fuse_mountopts" ] || fuse_mountopts="$fuse_mountopts," + fuse_mountopts="${fuse_mountopts}${option}" + ;; # these ones are interpreted during system initialization - "noauto") + "auto"|"noauto") ;; "_netdev") ;; + x-*) + # comments or userspace application-specific options, drop them + ;; *) warn "Invalid option $option"; exit 1 -- cgit