From c13823bd16b26bc471d3efb15f63b76fbfdf0309 Mon Sep 17 00:00:00 2001 From: Niels de Vos Date: Mon, 3 Sep 2012 12:49:21 +0200 Subject: mount/fuse: add mount-option "enable-ino32" for the native client By default the GlusterFS-native client uses 64-bit inodes. Some 32-bit applications can not handle these correctly. Introduce a client-side mount option "enable-ino32" which causes the FUSE-client to squash the 64-bit inodes into a 32-bit value. Change-Id: I3296d16528bfb50457b9675f6b8701234ed82ff0 BUG: 850352 Signed-off-by: Niels de Vos Reviewed-on: http://review.gluster.org/3885 Tested-by: Gluster Build System Reviewed-by: Anand Avati --- glusterfsd/src/glusterfsd.c | 16 ++++++++++++++++ glusterfsd/src/glusterfsd.h | 1 + 2 files changed, 17 insertions(+) (limited to 'glusterfsd') diff --git a/glusterfsd/src/glusterfsd.c b/glusterfsd/src/glusterfsd.c index 15760895ab9..2c19e680f99 100644 --- a/glusterfsd/src/glusterfsd.c +++ b/glusterfsd/src/glusterfsd.c @@ -145,6 +145,9 @@ static struct argp_option gf_options[] = { "Mount the filesystem with POSIX ACL support"}, {"selinux", ARGP_SELINUX_KEY, 0, 0, "Enable SELinux label (extened attributes) support on inodes"}, + {"enable-ino32", ARGP_INODE32_KEY, "BOOL", OPTION_ARG_OPTIONAL, + "Use 32-bit inodes when mounting to workaround broken applications" + "that don't support 64-bit inodes"}, {"worm", ARGP_WORM_KEY, 0, 0, "Mount the filesystem in 'worm' mode"}, {"mac-compat", ARGP_MAC_COMPAT_KEY, "BOOL", OPTION_ARG_OPTIONAL, @@ -341,6 +344,15 @@ set_fuse_mount_options (glusterfs_ctx_t *ctx, dict_t *options) } } + if (cmd_args->enable_ino32) { + ret = dict_set_static_ptr (options, "enable-ino32", "on"); + if (ret < 0) { + gf_log ("glusterfsd", GF_LOG_ERROR, + "failed to set dict value for key enable-ino32"); + goto err; + } + } + if (cmd_args->read_only) { ret = dict_set_static_ptr (options, "read-only", "on"); if (ret < 0) { @@ -650,6 +662,10 @@ parse_opts (int key, char *arg, struct argp_state *state) "*-md-cache.cache-selinux=true"); break; + case ARGP_INODE32_KEY: + cmd_args->enable_ino32 = 1; + break; + case ARGP_WORM_KEY: cmd_args->worm = 1; break; diff --git a/glusterfsd/src/glusterfsd.h b/glusterfsd/src/glusterfsd.h index 8f05e9f6e27..dab7f04181d 100644 --- a/glusterfsd/src/glusterfsd.h +++ b/glusterfsd/src/glusterfsd.h @@ -83,6 +83,7 @@ enum argp_option_keys { ARGP_GID_TIMEOUT_KEY = 160, ARGP_FUSE_BACKGROUND_QLEN_KEY = 161, ARGP_FUSE_CONGESTION_THRESHOLD_KEY = 162, + ARGP_INODE32_KEY = 163, }; struct _gfd_vol_top_priv_t { -- cgit