From 9777662406319422450989db104d5a588e52104d Mon Sep 17 00:00:00 2001 From: Kinglong Mee Date: Mon, 15 Oct 2018 15:41:23 +0800 Subject: md-cache: new option "cache-glusterfs-acl" for virtual glusterfs ACLs Change-Id: I020ab08dba48f13cf7b8908e96280f1e92e9b9db Updates: bz#1634220 Signed-off-by: Kinglong Mee --- xlators/performance/md-cache/src/md-cache.c | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) (limited to 'xlators/performance/md-cache/src/md-cache.c') diff --git a/xlators/performance/md-cache/src/md-cache.c b/xlators/performance/md-cache/src/md-cache.c index 3cd84c5df8c..3480a90b99b 100644 --- a/xlators/performance/md-cache/src/md-cache.c +++ b/xlators/performance/md-cache/src/md-cache.c @@ -63,6 +63,7 @@ struct mdc_statistics { struct mdc_conf { int timeout; gf_boolean_t cache_posix_acl; + gf_boolean_t cache_glusterfs_acl; gf_boolean_t cache_selinux; gf_boolean_t cache_capability; gf_boolean_t cache_ima; @@ -3208,9 +3209,11 @@ mdc_xattr_list_populate(struct mdc_conf *conf, char *tmp_str) strcat(mdc_xattr_str, "security.ima,"); if (conf->cache_posix_acl) - strcat(mdc_xattr_str, POSIX_ACL_ACCESS_XATTR - "," POSIX_ACL_DEFAULT_XATTR "," GF_POSIX_ACL_ACCESS - "," GF_POSIX_ACL_DEFAULT ","); + strcat(mdc_xattr_str, + POSIX_ACL_ACCESS_XATTR "," POSIX_ACL_DEFAULT_XATTR ","); + + if (conf->cache_glusterfs_acl) + strcat(mdc_xattr_str, GF_POSIX_ACL_ACCESS "," GF_POSIX_ACL_DEFAULT ","); if (conf->cache_swift_metadata) strcat(mdc_xattr_str, "user.swift.metadata,"); @@ -3471,6 +3474,9 @@ mdc_reconfigure(xlator_t *this, dict_t *options) GF_OPTION_RECONF("cache-posix-acl", conf->cache_posix_acl, options, bool, out); + GF_OPTION_RECONF("cache-glusterfs-acl", conf->cache_glusterfs_acl, options, + bool, out); + GF_OPTION_RECONF("cache-swift-metadata", conf->cache_swift_metadata, options, bool, out); @@ -3542,6 +3548,8 @@ mdc_init(xlator_t *this) GF_OPTION_INIT("cache-posix-acl", conf->cache_posix_acl, bool, out); + GF_OPTION_INIT("cache-glusterfs-acl", conf->cache_glusterfs_acl, bool, out); + GF_OPTION_INIT("cache-swift-metadata", conf->cache_swift_metadata, bool, out); @@ -3742,6 +3750,16 @@ struct volume_options mdc_options[] = { .description = "Cache posix ACL xattrs (system.posix_acl_access, " "system.posix_acl_default) on client side", }, + { + .key = {"cache-glusterfs-acl"}, + .type = GF_OPTION_TYPE_BOOL, + .default_value = "false", + .op_version = {GD_OP_VERSION_6_0}, + .flags = OPT_FLAG_SETTABLE | OPT_FLAG_CLIENT_OPT | OPT_FLAG_DOC, + .description = "Cache virtual glusterfs ACL xattrs " + "(glusterfs.posix.acl, glusterfs.posix.default_acl) " + "on client side", + }, { .key = {"md-cache-timeout"}, .type = GF_OPTION_TYPE_INT, -- cgit