summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/bugs/md-cache/bug-1211863.t22
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-volume-set.c9
-rw-r--r--xlators/performance/md-cache/src/md-cache.c30
3 files changed, 60 insertions, 1 deletions
diff --git a/tests/bugs/md-cache/bug-1211863.t b/tests/bugs/md-cache/bug-1211863.t
new file mode 100644
index 00000000000..b969fbb4b29
--- /dev/null
+++ b/tests/bugs/md-cache/bug-1211863.t
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+. $(dirname $0)/../../include.rc
+. $(dirname $0)/../../volume.rc
+
+cleanup;
+
+TEST glusterd
+
+TEST $CLI volume create $V0 $H0:$B0/$V0
+TEST $CLI volume start $V0
+
+TEST $CLI volume set $V0 cache-samba-metadata on
+EXPECT 'on' volinfo_field $V0 'performance.cache-samba-metadata'
+
+TEST $CLI volume set $V0 cache-samba-metadata off
+EXPECT 'off' volinfo_field $V0 'performance.cache-samba-metadata'
+
+TEST $CLI volume stop $V0
+TEST $CLI volume delete $V0
+
+cleanup;
diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-set.c b/xlators/mgmt/glusterd/src/glusterd-volume-set.c
index 9202763691c..31273fb5cea 100644
--- a/xlators/mgmt/glusterd/src/glusterd-volume-set.c
+++ b/xlators/mgmt/glusterd/src/glusterd-volume-set.c
@@ -1586,7 +1586,14 @@ struct volopt_map_entry glusterd_volopt_map[] = {
.description = "Cache swift metadata (user.swift.metadata xattr)",
.flags = OPT_FLAG_CLIENT_OPT
},
-
+ { .key = "performance.cache-samba-metadata",
+ .voltype = "performance/md-cache",
+ .option = "cache-samba-metadata",
+ .op_version = GD_OP_VERSION_3_9_0,
+ .description = "Cache samba metadata (user.DOSATTRIB, security.NTACL"
+ " xattr)",
+ .flags = OPT_FLAG_CLIENT_OPT
+ },
/* Crypt xlator options */
diff --git a/xlators/performance/md-cache/src/md-cache.c b/xlators/performance/md-cache/src/md-cache.c
index 31bc8d8187d..c1aef210e1d 100644
--- a/xlators/performance/md-cache/src/md-cache.c
+++ b/xlators/performance/md-cache/src/md-cache.c
@@ -33,6 +33,7 @@ struct mdc_conf {
gf_boolean_t cache_selinux;
gf_boolean_t force_readdirp;
gf_boolean_t cache_swift_metadata;
+ gf_boolean_t cache_samba_metadata;
};
@@ -71,6 +72,16 @@ static struct mdc_key {
.load = 0,
.check = 1,
},
+ {
+ .name = "user.DOSATTRIB",
+ .load = 0,
+ .check = 1,
+ },
+ {
+ .name = "security.NTACL",
+ .load = 0,
+ .check = 1,
+ },
{
.name = "security.capability",
.load = 0,
@@ -2314,6 +2325,12 @@ reconfigure (xlator_t *this, dict_t *options)
mdc_key_load_set (mdc_keys, "user.swift.metadata",
conf->cache_swift_metadata);
+ GF_OPTION_RECONF ("cache-samba-metadata", conf->cache_samba_metadata,
+ options, bool, out);
+ mdc_key_load_set (mdc_keys, "user.DOSATTRIB",
+ conf->cache_samba_metadata);
+ mdc_key_load_set (mdc_keys, "security.NTACL",
+ conf->cache_samba_metadata);
GF_OPTION_RECONF("force-readdirp", conf->force_readdirp, options, bool, out);
@@ -2356,6 +2373,13 @@ init (xlator_t *this)
mdc_key_load_set (mdc_keys, "user.swift.metadata",
conf->cache_swift_metadata);
+ GF_OPTION_INIT ("cache-samba-metadata", conf->cache_samba_metadata,
+ bool, out);
+ mdc_key_load_set (mdc_keys, "user.DOSATTRIB",
+ conf->cache_samba_metadata);
+ mdc_key_load_set (mdc_keys, "security.NTACL",
+ conf->cache_samba_metadata);
+
GF_OPTION_INIT("force-readdirp", conf->force_readdirp, bool, out);
out:
this->private = conf;
@@ -2419,6 +2443,12 @@ struct volume_options options[] = {
.default_value = "true",
.description = "Cache swift metadata (user.swift.metadata xattr)",
},
+ { .key = {"cache-samba-metadata"},
+ .type = GF_OPTION_TYPE_BOOL,
+ .default_value = "false",
+ .description = "Cache samba metadata (user.DOSATTRIB, security.NTACL"
+ " xattrs)",
+ },
{ .key = {"cache-posix-acl"},
.type = GF_OPTION_TYPE_BOOL,
.default_value = "false",